The only validation performed is based on file type and none based on file extensions, file size, or image resolution.

Comments

dave reid’s picture

I'm feeling blocked on this one. We can't really validate a file extension, file size, or things like image resolution (that we currently validate on the upload tab) here because the file isn't saved to the temporary directory until after validation has been run (preSave(), save(), and postSave()).

dave reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
dave reid’s picture

Title: The 'Web' tab when saving a remote file to local does not respect validation settings (extensions, file size, etc) » Ensure file validation (extensions, file size, etc) runs on other tabs than the 'Upload' tab.
Priority: Normal » Major

Upgrading to major.

dave reid’s picture

Upgrading to major.

dave reid’s picture

Issue tags: +needs backport to 1.x
drupov’s picture

Issue summary: View changes

Wouldn't is be enough for that validation (other tabs than upload) to be run on node save?

jasonawant’s picture

Hi,

Couldn't we validate the selected file from the library or my files tab client side in dialogOptions.buttons[ok] within Drupal.media.popups.mediaBrowser() in media.popup.js by comparing properties in var options.global to var selected[0].filemime, selected[0].filesize, selected[0].metadata.height and selected[0].metadata.height?

Doing so would create an UX issue, b/c content authors would not be able to see whether or not an image will validate before selecting it, causing great despair I imagine.

To remedy that, we would need to update the default Media Browser with updated or new exposed filters to allow content authors to filter valid files. We could use parameters in the media/browser callback, the iframe src, to automagically filter the view results with the supplied values.

Thoughts? I maybe narrowly defining this based on my focus on working with image files. Jason.

chris matthews’s picture

Assigned: dave reid » Unassigned
Status: Active » Closed (outdated)
Issue tags: -needs backport to 1.x

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team