I am building a Face Recognition app, where the user image when user clocks-in should be saved in files,
this is how i am trying to upload the files to file doctype,
is this correct, if so what should be the values to be passed to file_name, folder, file_url
but the checkin and checkout images are being saved at public/files ie.,
“public/files/Employee CheckIn/EMP-00992_20241002_124755.jpg”
Try using frm.call() and call your method or function you’re trying to call to save your file. And also add a decorator on your function @frappe.whitelist() explained in the link above.
Eg:-
Method:
frm.call({
doc: frm.doc,
method: "save_file"
});
Function:
frm.call({
doc: frm.doc,
method: "{{ complete path to function }}"
});
And also the file entry it created in the document but the file resides in public or private folder only.
Hope this helps.
hey @Dev1, i just want to know what value should be passed to file_url
i tried file_url = f"/private/files/{filename}" but getting error “File does not exist”
i am passing the image as base64Image to backend, now i want to upload the image in file doctype
it turns out value of file_url field is generated automatically when the file is uploaded successfully
we need to pass the file name, is_private, content and below is the code
btw below code is of HR PWA app