【发布时间】:2021-05-09 22:09:35
【问题描述】:
我是 drupal 7 的新手,我正在尝试创建 hook_file_presave / hook_file_validate / hook_field_validate 函数,用于检查网站上传的 pdf 文件是否没有密码保护。
如果文件受密码保护,我可以使用 php 轻松检查。但是当我显示错误消息时,它只显示错误消息也会上传文件。我想我没有使用右钩子。
function simpletest_file_presave($destination){
// here is my logic
drupal_set_message(t('file is encrypted >>>>>>>> '. $filename), 'error');
return;
}
Here you can see file shouldn't be uploaded buit its there with remove button.
【问题讨论】: