Closed (outdated)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Sep 2011 at 17:07 UTC
Updated:
26 Jan 2019 at 16:43 UTC
Jump to comment: Most recent
The only validation performed is based on file type and none based on file extensions, file size, or image resolution.
Comments
Comment #1
dave reidI'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()).
Comment #2
dave reidComment #3
dave reidUpgrading to major.
Comment #4
dave reidUpgrading to major.
Comment #5
dave reidComment #6
drupov commentedWouldn't is be enough for that validation (other tabs than upload) to be run on node save?
Comment #7
jasonawantHi,
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.
Comment #8
chris matthews commentedClosing 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