doulu5717 2016-03-02 16:58
浏览 122

PHP:将文件上传到本地ubuntu服务器

I have been working on a simple form that upload an Excel file to a server and manipulates it, then gives me the option to download it.

On my WAMP server it works perfectly!

After uploading it to the Local Ubuntu server i get this error on the "Network" after sending it to the file that handles it:

Request URL:http://10.0.0.66/PHPExcel/main.php
Request Method:POST
Status Code:500 Internal Server Error
Remote Address:10.0.0.66:80
Response Headers
view source
Connection:close
Content-Length:1
Content-Type:text/html; charset=UTF-8
Date:Wed, 02 Mar 2016 16:51:42 GMT
Server:Apache/2.4.12 (Ubuntu)
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:10621
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryTlu6BO9uHeeHBF5X
Cookie:ci_session=1ce8fcaf8b36c7a2cf254077b1682edca9e771e3
Host:10.0.0.66
Origin:http://10.0.0.66
Referer:http://10.0.0.66/PHPExcel/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
Request Payload
------WebKitFormBoundaryTlu6BO9uHeeHBF5X
Content-Disposition: form-data; name="file"; filename="0103.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet


------WebKitFormBoundaryTlu6BO9uHeeHBF5X
Content-Disposition: form-data; name="MOS"

android
------WebKitFormBoundaryTlu6BO9uHeeHBF5X--

What can be the problem?

I thought maybe it's because there aren't permissions to upload the files so I found this post: Enabling write permissions Ubuntu Server in var/www/image directory

and used:

root@server:/var/www/html# sudo chmod 664 *
root@server:/var/www/html# sudo find . -type d -exec chmod 755 "{}" \;

Is there a different way to upload a file to a Linux server than a local WAMP server?

  • 写回答

1条回答 默认 最新

  • dongzinen1061 2016-03-03 13:55
    关注

    For the specific folder where uploads land, ensure you have permission as 777, as suggested by Indrasinh

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)