The problem “No files were uploaded” occurred only for the php built-in web-server and after switching to httpd has never occurred again.
The writing problem with the httpd server was caused by the SELinux.
Frage
I am in the first stages of using/trying fineuploader, so I tried to build an example following the tutorial and I am unable to get it to work. It is always just retrying and in the log returning "No files were uploaded" that means $_SERVER['CONTENT_TYPE'] was not set.
I used the html like the one on the page in the section "Putting it together" (also downloaded the needed css, js and linked it to my php code): http://docs.fineuploader.com/quickstart/02-setting_options.html My php server code is exactly the one from https://github.com/Widen/fine-uploader-server/tree/master/php/traditional.
Can somebody please help me?
EDIT: I am actually trying in on two different servers now, there are 2 different errors in the browser console : For built-in php server:
"[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..."
For 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"}"
The request method is the same, no matter on what server I am running:
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
My opinion is that the problem is with the servers.
My code:
my endpoint.php: https://gist.github.com/mbriskar/9512416
my handler.php: https://gist.github.com/mbriskar/9512432
Lösung
The problem “No files were uploaded” occurred only for the php built-in web-server and after switching to httpd has never occurred again.
The writing problem with the httpd server was caused by the SELinux.