I'm working on the Media Multiselect module that enables PLUpload on multi-value Media fields. And on the fields you can specify a file directory (and schema for that matter).
So it basically allows you to specify the schema and directory part of the destination uri.

PLUpload, however, always just uses $destination = variable_get('file_default_scheme', 'public') . '://' . $file_info['name'];

Both core's File module, and File Entity's upload handles this by having the #upload_location-key sat on the file form-element, which then saves it accordingly.

So would it be possible to add support for the #upload_location key?

Morten Fangel.

#5 1776300-add_support_for_upload_destination_when_using_plupload-5.patch1.7 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 106 pass(es).
[ View ]
#4 1776300-add_support_for_upload_destination_when_using_plupload-4.patch1.22 KBParisLiakos
PASSED: [[SimpleTest]]: [MySQL] 106 pass(es).
[ View ]


Issue summary:View changes

Fixed a bug in the proposed code.

It would be possible :). Can you prepare patch?

I'll try. I'm not quite sure how to approach it yet. I had an attempt that didn't work as I wanted it to, so I'll have to dig a little deeper into how PLUpload saves files after upload. Don't know when I'll get the time to look at it though :/

Project:Plupload integration» File entity (fieldable files)
Version:7.x-1.x-dev» 7.x-2.x-dev

Actually this issue belongs to file entity....after spending quite some time till i figure out how plupload saves the file, i ended up that file_entity_add_upload_multiple_submit is the one thats responsible for this.
patch soon to come

Status:Active» Needs review
new1.22 KB
PASSED: [[SimpleTest]]: [MySQL] 106 pass(es).
[ View ]

here it is

new1.7 KB
PASSED: [[SimpleTest]]: [MySQL] 106 pass(es).
[ View ]

And this patch provides image scaling to maximum-minimum settings in field configuration...
Although my gut tells me that this is a hack, and plupload does something in the wrong way

Title:Support for upload destinationRespect field settings like minimum - maximum size when used as image field
Project:File entity (fieldable files)» Plupload integration
Version:7.x-2.x-dev» 7.x-1.x-dev
Status:Needs review» Needs work

commited #4.
for #5 i think plupload is responsible. so i transfer it back to plupload issue queue

Status:Needs work» Postponed (maintainer needs more info)

I believe this should already work through #upload_validators:

$form['my_element'] = array(
  '#type' => 'plupload',
  '#title' => t('Upload files'),
  '#description => t('This multi-upload widget uses Plupload library.'),
  '#upload_validators' => array(
    'file_validate_image_resolution' => array('1000', '1000'),
  '#plupload_settings' => array(
    'runtimes' => 'html5',
    'chunk_size => '1mb',

Status:Postponed (maintainer needs more info)» Closed (duplicate)

Yeah, well i kept digging this and turns out this is a media issue afterall.
closing this in favor of #1761496: Implement a value_callback for media element

Issue summary:View changes

Proposed code didn't work at all, so removed to avoid confusion.