Is there a way to use an arbitrary directory for uploading a file? One that is not the public or private folder? I do not mind if it doesn't save a record in the Database.
$form['upload_logo'] = array(
'#type' => 'managed_file',
'#title' => t('Upload a Logo'),
'#weight' => 18,
'#upload_location' => drupal_realpath('sites/all/files/images/logos'),
'#upload_validators' => array('file_validate_extensions' => array('png gif jpg jpeg')),
);
The current code returns this message: The file could not be uploaded, because the destination "Path Generated By drupal_realpath()" is invalid.
'#upload_location' => 'file:///path/to/file.ext'
? – Clive♦ Aug 5 '15 at 18:19file:///var/www/...
) – Clive♦ Aug 5 '15 at 19:59