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,

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

@Nasir_Khan It’s ok bro thank u

1 Like