doubingjian2006 2010-05-25 21:34
浏览 54
已采纳

如何在PHP中调试move_uploaded_file()

move_uploaded_file() won't work for me anymore, it was working fine and just stopped out of nowhere. Is there a way for me to check why it's not working anymore? Here's what I currently have, but it only returns TRUE or FALSE.

$status = move_uploaded_file($tempFile, $targetFile);
if($status) {
  echo 'its good';
} else {
  echo 'it failed';
}

I know the path is 100% correct and the directory is CHMOD 755. Is there anything I might be doing wrong?

  • 写回答

3条回答 默认 最新

  • dongzhi2014 2010-05-25 21:47
    关注

    Maybe this will work:

    if(!move_uploaded_file($_FILES['attachement']['tmp_name'], $uploadfile)) {
    
    echo 'Your file was not uploaded please try again
    here are your debug informations:
    '.print_r($_FILES);
    
          } else {
    
              echo 'image succesfully uploaded!';
    
          } 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services