bolt / forms

MIT License
21 stars 27 forks source link

Boltforms uploads/attachments ignore config settings #82

Open ghost opened 3 years ago

ghost commented 3 years ago

Working with bolt 5 beta 10.

The uploads: settings seems to be ignored entirely and files are uploaded to /uploads/ by default even if enabled is explicitly set to false. As far as I've been able to tell, all child keys are ignored.

filename_handling: "suffix" is also ignored. defaults to prefix.

I have no clue if management_controller works as expected, but I've set it to false.

the attach_files: true key is also ignored.

At this point file type fields cannot safely be used.

My result: emails submit without attachments and my uploads folder is flooded with files.

UtechtDustin commented 1 year ago

I run in the same issue, it seems the documentation is not up to date. I checked the source code and you have to add attach: true to the file field(s).

https://github.com/bolt/forms/blob/485b88de8a630c6226b39912068b5faf73222a16/src/EventSubscriber/FileUploadHandler.php#L58-L60