Open peterboorsma opened 3 years ago
hi @peterboorsma, yes this is definitely a bug, but a tricky one. Here's a few details:
The acceptedFileTypes
are set correctly here:
https://github.com/bolt/core/blob/4.1/src/Controller/Backend/Async/UploadController.php#L82
The bug appears when Bolt is trying to create a Media entity here: https://github.com/bolt/core/blob/4.1/src/Controller/Backend/Async/UploadController.php#L118
Right now, the MediaFactory
only allows media file types (which, sort of makes sense)
https://github.com/bolt/core/blob/4.1/src/Factory/MediaFactory.php#L47
If we simply add the file types to the MediaFactory
, there will be no distinction between the accept_media_types
and accept_file_types
, which also doesn't sound like the right approach.
🤷♂️ @bobdenotter any ideas?
The drag 'n drop file uploader in /bolt/filemanager/files does not accept zip files while zip is in the
accept_file_type
listaccept_file_types: [ twig, html, js, css, scss, gif, jpg, jpeg, png, ico, zip, tgz, txt, md, doc, docx, pdf, epub, xls, xlsx, ppt, pptx, mp3, ogg, wav, m4a, mp4, m4v, ogv, wmv, avi, webm, svg, webp, avif]
In order to be able to upload zip files you have to add the extension to the
accept_media_types
array. I find this confusing because zip is not a media typ IMOaccept_media_types: [ gif, zip, jpg, jpeg, png, svg, pdf, mp3, tiff, avif, webp ]
Above
accept_file_type
config.yaml states:Details
Bolt 4.1.15
System Information:
Reproduction
If you're filing a bug, please describe how to reproduce it. Include as much relevant information as possible, such as:
Bug summary
Specifics
Steps to reproduce
Expected result
Actual result