我希望将上传的文件在公共位置移动://到mymodule中的一个文件夹。
我试着
$dirname = dirname(__file__);
$fullpath = strpos($dirname, '\\') === false ? $dirname . '/' . $file->filename : $dirname . '\\' . $file->filename;
$go = file_move($file, $fullpath);我得到了这个错误
The specified file public://xxx.BMP could not be moved, because the destination is invalid. More information is available in the system log.但是de $destination是有效的,是我模块的文件夹!!
有人能帮我挪一下吗?
谢谢!
发布于 2013-10-31 06:48:11
通常,将文件移动到模块文件夹不是个好主意。但是,如果要这样做,请使用相对于drupal根或绝对文件路径的path。此外,检查模块目录的文件夹权限(默认情况下,模块文件夹是只读的).如果这没有帮助,我建议您检查系统日志以获得更详细的错误解释。
发布于 2015-12-20 19:48:20
最好是公开地移动文件://
$dest = 'public://';
$file = file_move($file, $dest)https://stackoverflow.com/questions/19697335
复制相似问题