【发布时间】:2011-01-18 23:45:11
【问题描述】:
我在将文件上传到网络共享文件夹时遇到问题。我可以通过在 IE 中使用 Windows 身份验证连接到该文件夹。脚本如下:
$target_path = '\\\\server\\images\\';
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
当我运行它时,我收到一条错误消息:
警告: move_uploaded_file(\server\images\pic_firefox.jpg) [function.move-uploaded-file]: 失败 打开流:权限被拒绝 C:\xxxxxxxxx\uploader.php 在第 6 行
我认为这是因为 Windows 身份验证不能以这种方式工作。有没有办法可以使用用户名/密码上传文件?任何想法将不胜感激。
【问题讨论】:
-
您是否有权访问该文件夹?
-
您确定您对该文件夹有写权限吗?尝试正常映射到驱动器,看看是否可以放入文件。
-
是的,我无意回答这个问题,而是我现在的问题。你是我的双胞胎吗?
-
我是来自未来的你。
标签: php upload networking directory shared