function webfm_upload_new in Web File Manager 5
1 call to webfm_upload_new()
- webfm_version_upload in ./webfm.module
- Version uploaded file that overwrites existing file
NOTE: uploaded file is already stored in $_SESSION['temp_upload'] via iframe.
Feedback in ajax since drupal_set_message points back into main page (not refreshed).
File
- ./webfm.module, line 1765
Code
function webfm_upload_new(&$msg) {
if (file_move($_SESSION['temp_upload'], $_SESSION['temp_upload']->dest)) {
if (($ret = webfm_dbinsert_file($_SESSION['temp_upload'], $msg)) !== FALSE) {
$msg = t('Upload success');
return $ret;
}
else {
file_delete($_SESSION['temp_upload']->filepath);
return FALSE;
}
}
else {
$msg = t('file_move to ') . $_SESSION['temp_upload']->dest . t(' failed');
return FALSE;
}
}