简体   繁体   English

如何将php中的move_uploaded_files移至自定义位置

[英]How to move_uploaded_files in php to a customize location

i want to move_uploaded files a folder back in my server directory structure but doesn't seems to work here is my script 我想将我的服务器目录结构中的一个文件夹move_uploaded文件放回去,但似乎无法正常工作,这是我的脚本

$filename='image.jpg';
$path="../folder".$filename;
if(move_uploaded_file($_FILES["uplogo"]["tmp_name"],$path))
    {
        echo "success";
}

the path ../folder is not working and when i do /folder it work so how can i mange my upload in this way 路径../folder不起作用,当我做/ folder时起作用,所以我该如何管理上传

$path="../folder/".$filename;

A forward slash was missing at the end of folder , which means it was trying to move the file to: folder末尾缺少正斜杠,这表示它正试图将文件移至:

../folderimage.jpg

as opposed to: 相对于:

../folder/image.jpg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM