function _filebrowser_build_new_upload_file_name in Filebrowser 6.2
Same name and namespace in other branches
- 8 filebrowser.common.inc \_filebrowser_build_new_upload_file_name()
- 7.4 filebrowser.common.inc \_filebrowser_build_new_upload_file_name()
- 7.2 filebrowser.common.inc \_filebrowser_build_new_upload_file_name()
- 7.3 filebrowser.common.inc \_filebrowser_build_new_upload_file_name()
Parameters
form_state:
i:
path_info_new:
path_info_old:
2 calls to _filebrowser_build_new_upload_file_name()
- filebrowser_form_upload_submit in ./
filebrowser.form.upload.inc - uploads submition.
- filebrowser_form_upload_validate in ./
filebrowser.form.upload.inc - uploads validation.
File
- ./
filebrowser.form.upload.inc, line 30
Code
function _filebrowser_build_new_upload_file_name($node, $form_state, $i) {
$file_name = $_FILES['files']['name']["file_{$i}"];
if (!empty($form_state['values']["file_name_{$i}"])) {
$path_info_new = pathinfo($form_state['values']["file_name_{$i}"]);
$path_info_old = pathinfo($file_name);
$file_name = $path_info_new['filename'];
if (isset($path_info_old['extension'])) {
$file_name .= ".{$path_info_old['extension']}";
}
}
_filebrowser_load_files($node);
$target = _filebrowser_convert_to_fs_encoding($node, $node->file_listing['.']['full-path'] . "/" . $file_name);
return $target;
}