Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $form['folder_name'] = array(
- '#type' => 'textfield',
- '#title' => t('Folder Name'),
- );
- $form['document'] = array(
- '#type' => 'managed_file',
- '#upload_validators' => array('file_validate_extensions' => array('xml')),
- '#upload_location' => 'public://',
- '#submit' => array('custom_document_submit'),
- );
- function custom_document_submit($form, &$form_state){
- $destination = $form_state['values']['folder_name'];
- $validators = array();
- $file = file_save_upload('document', $validators, 'public://'.$destination);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement