Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just tried to upload some modern Word documents, which fail validation, because docx is not supported in this function:
/**
* Helper function to add defaults to $element['#upload_validators'].
*/
function _plupload_default_upload_validators() {
return array(
// See file_save_upload() for details.
'file_validate_extensions' => array('jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
);
}
Patch in a bit.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1454326-plupload-validators.patch | 742 bytes | agentrickard |
Comments
Comment #1
agentrickardNot sure this matters, since it is overridden by media module via the UI.
Comment #2
slashrsm CreditAttribution: slashrsm commentedThis is just default setting. Any implementing module can set it's own. If you use media navigate to admin/config/media/browser, where you can set this.
Comment #3
Katrina B CreditAttribution: Katrina B commentedActually, setting the allowed extensions didn't work for me. I have an image field set to use jpeg, jpg, png, and gif -- but after changing the widget type to plupload (using Plup and Plupload modules and plupload library), I cannot upload .jpg files,
Comment #4
slashrsm CreditAttribution: slashrsm commentedThat should be reported in Plup's issue queue then. AFAIK Plup doesent even need this module, as it implementes it's own integration with plupload library.