My module uses a plupload form field. I'm trying to define a custom directory for my plupload uploads.
A normal upload form for a managed file looks something like this:
$form['managed_file'] = array(
'#title' => t('Managed file example'),
'#type' => 'managed_file',
'#upload_validators' => array(
'file_validate_extensions' => array('jpeg jpg png gif'),
'MODULENAME_validate_not_filename' => array('test.')),
'#upload_location' => 'public://imagebank',
'#progress_indicator' => 'bar',
'#progress_message' => 'One moment while we save your file...',);
Plupload integrations module suggests using following code to integrate an Plupload form in a custom module:
$form['my_element'] = array(
'#type' => 'plupload',
'#title' => t('Upload files'),
'#description' => t('This multi-upload widget uses Plupload library.'),
'#upload_validators' => array(
'file_validate_extensions' => array(
'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp'),
'my_custom_file_validator' => array('some validation criteria'),
),
'#plupload_settings' => array(
'runtimes' => 'html5',
'chunk_size' => '1mb',
),
);
In a managed file form there is this parameter to set upload location uri:
'#upload_location' => 'public://imagebank',
In the plupload form I see no such parameter.
I'm still learning custom module development so the answer might be obvious, but it isn't for me atleast. Could someone please point me in the right direction? The files should be uploaded to public://imagebank