Try ERPNext Buy Support Partners Foundation

How to Upload image or file using rest api

I create the web page and store the data in the doctype. The problem is in html file type data are not store. In doctype i give the field type attach and store the data. The url stored in the particular field type but the file is not showing.

The flow i am using is… html -> javascript (using frappe call to pass the data)->python (frappe whitelist)

for example my image file url c:\fakepath\image.jpg This url stored in the doctype but the file is not showing…

@Nasir_Khan bro if u know the answer plz share me

You can simply add a custom field for attach image in the Job Applicant DocType and then set it in the Job Applicant web form by which you will not need to use any custom script or api.

In customize form,

In web form,

@Nasir_Khan

Bro In the web form its working fine. But i am using webpage to write manual code (for design purpose). Html,css,javascript like that…

So I am using frappe.call to pass all the html data to python. But i didn’t pass upload file type data to python using frappe call. The value passing like fakepath url. so image or file didn’t store. I refer something in online using base64 url to store the file or image. So if you know that plz share…


Ohh, sorry I am not that much good at backend development.

@Nasir_Khan It’s ok bro thank u