function filebrowser_form_upload_submit in Filebrowser 7.4
Same name and namespace in other branches
- 8 filebrowser.module \filebrowser_form_upload_submit()
- 6.2 filebrowser.form.upload.inc \filebrowser_form_upload_submit()
- 7.2 filebrowser.module \filebrowser_form_upload_submit()
- 7.3 filebrowser.module \filebrowser_form_upload_submit()
uploads submission. @inheritdoc
File
- ./
filebrowser.module, line 707
Code
function filebrowser_form_upload_submit($form, &$form_state) {
$node = $form_state['values']['node'];
$target = _filebrowser_build_new_upload_file_name($node, $form_state);
$success = copy($_FILES['files']['tmp_name']['file'], $target);
if (!$success) {
drupal_set_message(t("Unable to upload this file, do you have filesystem right to do that ?"), 'error');
}
else {
_filebrowser_load_files($node, NULL, TRUE);
// force listing rebuild
if (!empty($form['filebrowser_uploads']["description"])) {
$file = $node->file_listing[_filebrowser_safe_basename($target)];
module_invoke_all('filebrowser_metadata_set', $file, array(
'description' => $form_state['values']["description"],
));
}
}
drupal_goto("node/{$node->nid}/{$node->file_listing['.']['fid']}", _filebrowser_url_query());
}