Filtering uploads using upload_mimes
-
I am trying to prevent contributors on my site from uploading anything but jpg, png, and gif files. I would prefer that they not even be able to select other file types in the file dialogs. I have created a filter using
upload_mimes
and it is working, but it seems to be implemented differently based on whichAdd Media
button is clicked. Here is what I am seeing:From the
Media Library
, if I display the files in grid view and clickAdd New
, a file uploader appears above the grid. When I clickSelect Files
, the file dialog only allows me to select my filtered file types — jpg, png, and gif. All other file types are greyed out. This is perfect and exactly what I want.If I display the files in list view and click
Add New
, or clickAdd New
in the left menu, I am taken to a differentUpload New Media
page. When I clickSelect Files
, the file dialog is not filtered and all file types can be selected.For both of these examples, I’m using the multi-file uploader. However, the browser uploader also does not filter the file types in the file dialog.
Finally, when creating / editing a post, clicking on the
Add Media
button opens theAdd Media
dialog. Selecting files here also filters correctly and greys out all other file types.Additionally, the grid view and post uploaders also work correctly for files that are dragged and dropped — meaning the file type is checked and an error is displayed before the file is uploaded. The list view, left menu, and browser uploader do not check for file type errors until after the file has been uploaded.
I guess my question is, why the inconsistency? Is this a known issue? IMHO, the list view and left menu — which both lead to the
Upload New Media
page — should work the same as the grid view and post uploaders. Are there any plans to standardize how the different uploaders work?Thanks!
- The topic ‘Filtering uploads using upload_mimes’ is closed to new replies.