【发布时间】:2016-03-11 03:57:05
【问题描述】:
我正在尝试将图像上传到与我的 php 文件位于不同目录中的文件夹中。目前,我的 php 文件保存在测试/管理方面,我想将我的图像上传到测试/照片中。可以查看数据库中手动设置的链接,作为已复制到 testing/photos 文件夹中的图像。但是对于上传部分,我尝试将路径设置为 /testing/photos/ 但上传根本不起作用。我使用 microsoft azure 作为服务器,我不确定我应该如何设置上传功能的路径。
move_uploaded_file($_FILES["image"]["tmp_name"],"/testing/photos/" . $_FILES["image"]["name"], $target);
$location="/testing/photos/" . $_FILES["image"]["name"];
$type=$_POST['type'];
$rate=$_POST['rate'];
$desc=$_POST['desc'];
$qty=$_POST['qty'];
【问题讨论】:
-
您应该改用相对路径。例如,
../photos/ -
我尝试过 ../photos/ 和 .../testing/photos ,但都没有成功
标签: php azure image-uploading