dongtaochan0777 2015-07-08 15:17
浏览 46
已采纳

move_uploaded_file不再工作了

I made a website a couple of year ago which has worked fine till now.

now, when I try to load an image from the backend it raises me some warning and the Image fails to be moved in the destination directory.

here is the warning I get

Warning: move_uploaded_file(path/image_name.jpg): failed to open stream: Permission denied in D:\inetpub\websemote_directory\php_script_name.php on line 184

Warning: move_uploaded_file(): Unable to move 'C:\PHPVersions\PHP55\uploadtemp\php418A.tmp' to 'path/image_name.jpg' in D:\inetpub\websemote_directory\php_script_name.php on line 184

here is the line giving me the warning

if (!move_uploaded_file($_FILES['img_'.$pos]['tmp_name'], 'path/'."part_of_image_name".$_FILES['img_'.$pos]['name'])) {
          $msg = "<p>Error loading image!!</p>";
          break;
        } 

it does not even print the error message.

I tried to change permissions on directory (and all subdirs and files) via ftp but I'm not sure it succeded because it was giving me the following message

Comando: SITE CHMOD 740 Photo4.jpg.
Risposta: 500 'SITE': command not understood

(by the way I read somewhere that it does not fix the problem. However the guy said he solved by using some magic which is not working for me - or I'm misunderstanding how to do it)

Everything worked until a few days/weeks ago (the customer wasn't clear on that point) so I just wanted to know if this is a kind of known issue or what (and a possible solution), since after a littlebit of research I could not find anything usefull.

  • 写回答

2条回答 默认 最新

  • doufei3152 2015-07-11 09:25
    关注

    Found out to solve the problem by using the control panel of site hosting provider to change manually permissions on directory.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料