我处于使用/尝试fineuploader的第一阶段,所以我尝试按照教程构建一个示例,但我无法让它工作。它始终只是重试并在日志中返回"没有上传文件"这意味着$ _SERVER [' CONTENT_TYPE']未设置。
我使用的html就像页面上的那个h"把它放在一起" (还下载了所需的css,js并将其链接到我的php代码):http://docs.fineuploader.com/quickstart/02-setting_options.html 我的php服务器代码正是来自https://github.com/Widen/fine-uploader-server/tree/master/php/traditional的代码。
有人可以帮帮我吗?
编辑: 我现在正在尝试使用两个不同的服务器,浏览器控制台中有两个不同的错误: 对于内置的php服务器:
"[Fine Uploader 4.3.1] Retrying java.jpg..." jquery.fineuploader-4.3.1.min.js:16
18:37:30.195 "[Fine Uploader 4.3.1] Sending upload request for 0" jquery.fineuploader-4.3.1.min.js:16
18:37:30.199 "[Fine Uploader 4.3.1] xhr - server response received for 0" jquery.fineuploader-4.3.1.min.js:16
18:37:30.199 "[Fine Uploader 4.3.1] responseText = {"error":"No files were uploaded.","uploadName":null}" jquery.fineuploader-4.3.1.min.js:16
18:37:30.199 "[Fine Uploader 4.3.1] Received response status 200 with body: {"error":"No files were uploaded.","uploadName":null}" jquery.fineuploader-4.3.1.min.js:16
18:37:30.200 "[Fine Uploader 4.3.1] Waiting 5 seconds before retrying java.jpg..."
对于apache httpd:
"[Fine Uploader 4.3.1] Retrying java.jpg..." jquery.fineuploader-4.3.1.min.js:16
18:36:55.356 "[Fine Uploader 4.3.1] Sending upload request for 0" jquery.fineuploader-4.3.1.min.js:16
18:36:55.361 "[Fine Uploader 4.3.1] xhr - server response received for 0" jquery.fineuploader-4.3.1.min.js:16
18:36:55.361 "[Fine Uploader 4.3.1] responseText = {"error":"Could not save uploaded file.The upload was cancelled, or server error encountered","uploadName":"java.jpg"}" jquery.fineuploader-4.3.1.min.js:16
18:36:55.361 "[Fine Uploader 4.3.1] Received response status 200 with body: {"error":"Could not save uploaded file.The upload was cancelled, or server error encountered","uploadName":"java.jpg"}"
请求方法是相同的,无论我在哪台服务器上运行:
Request URL: http://localhost:8000/webpage/html/php/fineuploader/endpoint.php
Request Method: POST
Status Code: HTTP/1.1 200 OK
Request Headers 18:37:30.000
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0
Referer: http://localhost:8000/webpage/html/index.html
Pragma: no-cache
Host: localhost:8000
Content-Type: multipart/form-data;
Content-Length: 13274
Connection: keep-alive
Cache-Control: no-cache
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Response Headers Δ1ms
X-Powered-By: PHP/5.5.10
Host: localhost:8000
Content-Type: text/plain
Connection: close
我的观点是问题出在服务器上。
我的代码:
我的endpoint.php:https://gist.github.com/mbriskar/9512416
我的handler.php:https://gist.github.com/mbriskar/9512432
答案 0 :(得分:1)
问题“没有上传文件”仅针对php内置网络服务器发生,并且在切换到httpd之后再也没有发生过。
httpd服务器的写入问题是由SELinux引起的。