ds2128629 2011-06-08 04:49
浏览 220
已采纳

move_uploaded_file文件不存在?

Quick question I am trying to move an uploaded file to a directory outside of the root to /opt/ffencoderd/data/media and I get file does not exist. If I use exec() in the same file to execute clamscan in /usr/bin/clamscan it works. Anyone know what I am doing wrong?

move_uploaded_file($_FILES['Filedata']['tmp_name'], '/opt/ffencoderd/data/media'.'/'.$id2)
or die ("Couldn't upload ".$_FILES['Filedata']['name']."
");

Warning: move_uploaded_file(opt/ffencoderd/data/media/fa3eeb1d502ec3cb7221cac889a8922a) to open stream: No such file or directory in /opt/lampp/htdocs/xampp/site/progressbar/upload.php on line 99

Warning: move_uploaded_file() to move '/tmp/phpRh2VMZ' to 'opt/ffencoderd/data/media/fa3eeb1d502ec3cb7221cac889a8922a' in /opt/lampp/htdocs/xampp/site/progressbar/upload.php on line 99

  • 写回答

1条回答 默认 最新

  • dream989898 2011-06-08 05:04
    关注

    Test that the directory exists and that your PHP script has permissions to write to it with:

    echo is_writable('/opt/ffencoderd/data/media');
    

    If it returns false it may be that the directory doesn't exist. If you know the directory exists then you will need to modify permissions on the directory. If it has the correct permissions then you'll need to check your safe_mode and open_basedir settings.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 表达式必须是可修改的左值
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题