Try ERPNext Buy Support Partners Foundation

Web form with attachment field (as guest)

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: https://github.com/frappe/frappe/issues/6774

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