Change upload path

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

Files uploaded as field respect field path settings. For files uploaded via the provider's form (Scald Flash, Scald Audio...), use hook_form_FORM_ID_alter() to modify the path. For example, to change Flash path to the 'atoms/swf/YYYY/mm/dd' structure:

function mymodule_form_scald_atom_add_form_add_alter(&$form, $form_state, $form_id) {
  if ($form_state['scald']['source'] == 'scald_flash') {
    $form['file_swf']['#upload_location'] = 'public://atoms/swf/' . date('Y/m/d');
  }
}

Help improve this page

Page status: Not set

You can: