Hi,
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?
Regards
Morten Fangel.
Comments
Comment #0.0
fangel CreditAttribution: fangel commentedFixed a bug in the proposed code.
Comment #1
slashrsm CreditAttribution: slashrsm commentedIt would be possible :). Can you prepare patch?
Comment #2
fangel CreditAttribution: fangel commentedI'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 :/
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedActually 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
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedhere it is
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedAnd 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
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedcommited #4.
for #5 i think plupload is responsible. so i transfer it back to plupload issue queue
Comment #7
slashrsm CreditAttribution: slashrsm commentedI believe this should already work through #upload_validators:
Comment #8
ParisLiakos CreditAttribution: ParisLiakos commentedYeah, 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
Comment #8.0
ParisLiakos CreditAttribution: ParisLiakos commentedProposed code didn't work at all, so removed to avoid confusion.