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.

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

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!