function filebrowser_form_upload_validate in Filebrowser 7.4
Same name and namespace in other branches
- 8 filebrowser.module \filebrowser_form_upload_validate()
- 6.2 filebrowser.form.upload.inc \filebrowser_form_upload_validate()
- 7.2 filebrowser.module \filebrowser_form_upload_validate()
- 7.3 filebrowser.module \filebrowser_form_upload_validate()
uploads validation.
File
- ./
filebrowser.module, line 672
Code
function filebrowser_form_upload_validate($form, &$form_state) {
$node = $form_state['values']['node'];
_filebrowser_load_files($node);
$target = _filebrowser_build_new_upload_file_name($node, $form_state);
if (!$node->folder_uploads->allow_overwrite && file_exists($target)) {
form_error($form['filebrowser_uploads']["file"], t("This file already exists."));
}
if (!empty($node->folder_uploads->accepted_uploaded_files) && !_filebrowser_match_path($target, $node->folder_uploads->accepted_uploaded_files)) {
form_error($form['filebrowser_uploads']["file"], t("Sorry, you can't upload this kind of file."));
}
}