dongyili5843 2018-05-11 08:08
浏览 98

重命名服务器文件错误(http包装器不支持重命名)[PHP]

On my page users can upload documents, which will be saved in a user specific folder. the directories are stored in a url: http://localhost/folder/user/documentA_user_timestamp.ext inside a database.

Users can also delete a file, which deletes the file's entry inside the database but i want the file to be moved to a specified archive folder. However i always get this error message when the php rename() tries to do its work:

http wrapper does not support renaming in...

I can't seem to get my head around the error message and figure out whats the cause for it

$filepath = $_POST['file'];
$archivePath = FILESYS_DOCS_ARCHIVE . basename($filepath);

if (!file_exists(FILESYS_DOCS_ARCHIVE)){
    mkdir(FILESYS_DOCS_ARCHIVE, 0777);
}

$success = rename($filepath, $archivePath);

if ($success){
    echo "SUCCess";
} else {
   echo $archivePath;
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 shape_predictor_68_face_landmarks.dat
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料