You are here

function filebrowser_form_plupload_upload_submit in Filebrowser 7.4

uploads submission. @inheritdoc

File

./filebrowser.module, line 730

Code

function filebrowser_form_plupload_upload_submit($form, &$form_state) {
  $node = $form_state['values']['node'];
  foreach ($form_state['values']['file'] as $upload) {
    $file_name = $upload['name'];
    $target = _filebrowser_encoding_to_fs($node, $node->file_listing['.']['full-path'] . "/" . $file_name);
    $success = copy($upload['tmppath'], $target);
    if (!$success) {
      drupal_set_message(t("Unable to upload this file, do you have filesystem right to do that ?"), 'error');
    }
  }
  _filebrowser_load_files($node, NULL, TRUE);

  // force listing rebuild
  drupal_goto("node/{$node->nid}/{$node->file_listing['.']['fid']}", _filebrowser_url_query());
}