douwen5246 2014-07-24 06:52
浏览 55
已采纳

无法在Ubuntu上使用PHP上传文件

I try a simple php upload file on Ubuntu, it not work. Even it work on Window

Here my html coded.

<form action="upload.php" method ="post" enctype="multipart/form-data">
    <input type="file" name="file" />
    <input type="submit" value="submit" name="submit"/>
</form>

Here my php coded.

<?php
  $name = $_FILES['file']['name'];
  $temp = $_FILES['file']['tmp_name'];

  if(move_uploaded_file($temp,"upload/".$name)){
   echo "Your file was uploaded";
}
 else
{ 
 echo "Your file cound't upload";
}

?>
  • 写回答

3条回答 默认 最新

  • dpw43061 2014-07-24 07:23
    关注

    Check that you have given the write access to the "APACHE" on the directory.

    Hope this will solve the problem.

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

报告相同问题?

悬赏问题

  • ¥15 关于#wireshark#的问题:并且能够给数据做标注,如这个流量是在看视频或者是在转账
  • ¥90 请问,这个视频播放软件的名称,用过的朋友请给答案,上方..avi是啥意思?是看短剧还是播放本地视频?
  • ¥15 运筹优化,gurobi,python
  • ¥15 基于python的电影系统推荐
  • ¥20 springmvc重定向和返回json
  • ¥15 数学建模——参会安排怎么做
  • ¥15 电脑键盘实现触摸功能
  • ¥25 matlab无法将表达式转换为双数组怎么解决?
  • ¥15 单片机汇编语言相关程序
  • ¥20 家用射频美容仪技术规格