Sometime between Frappe 11.0.3-beta.29 and 11.0.3-beta.43, permissions handling was changed for uploading attachments to webforms as Guest. Before, I was able to create webforms that allowed anonymous users to attach files, but now on those same forms anonymous users are given a “Not allowed” error within the upload dialog.
Is this an intentional change? If so, is it possible to restore the old functionality, where Guest users could attach files to webform submissions? I tried every configuration I could think of on permissions for File, my submission doctype, etc., but no luck. Help is much appreciated!
Well, a little bit of progress, but not much. The initial permissions error was being caused by a whitelisted function, frappe.core.doctype.file.file.validate_filename, lacking the
allow_guest=True parameter. If I change the whilelisting of validate_filename in files.py to
@frappe.whitelist(allow_guest=True), I no longer get the permissions error.
Nevertheless, it still doesn’t work. When I try to attach a file it just hangs at the upload. I have filed a bug report here: Regression: attaching files to web forms fails without errors · Issue #6774 · frappe/frappe · GitHub
enable “Allow Guests to Upload Files” under system setting
Thanks Ashish. That fix was introduced after my post was made. Good for folks in the future to know!
You are right…it is v12 onwards
Still facing a similar error even though Guest Upload has been allowed! Pls see console trace below:
FileUploader.vue?rollup-plugin-vue=script.js:385 Uncaught TypeError: Cannot read property 'cleanup' of undefined at XMLHttpRequest.r.onreadystatechange (FileUploader.vue?rollup-plugin-vue=script.js:385)
Any ideas? Is this a bug?
Did you find a solution to the problem?