2014-03-12 59 views
1

我在使用/嘗試fineuploader的第一階段,所以我試圖建立一個示例,遵循本教程,我無法讓它工作。它始終只是重試,並在日誌返回「沒有文件上傳」,這意味着$ _SERVER ['CONTENT_TYPE']沒有設置。FineUploader說「沒有文件上傳」

我使用的HTML像在部分頁面上的一個「將其組合在一起」(也下載了所需的CSS,JS和它連接到我的PHP代碼):http://docs.fineuploader.com/quickstart/02-setting_options.html 我的PHP服務器的代碼是從完全相同的一個https://github.com/Widen/fine-uploader-server/tree/master/php/traditional

有人可以幫我嗎?

編輯: 我其實是想在兩個不同的服務器,現在,有在瀏覽器控制檯 2個不同的錯誤: 對於內置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

如果您需要幫助,例如服務器代碼和控制檯日誌消息,則需要提供更多信息。 –

+0

嗨,謝謝,代碼實際上只是你的教程的副本。對於服務器代碼,我使用https://github.com/Widen/fine-uploader-server/tree/master/php/traditional,我只更改了endpoint.php中的allowedExtension行。對於客戶端代碼,我只使用教程中的代碼片段來鏈接端點url以匹配endpoint.php。 javascript和css被下載,所以應該沒有問題。 –

+0

你在控制檯看到什麼信息?另外,請根據您的瀏覽器的開發工具提供請求標頭/有效載荷。這個問題可能出現在你的服務器代碼中,也可能與你的服務器配置有關。 –

回答

1

問題「未能上傳任何文件」只爲PHP內置發生在網絡服務器和切換到httpd後再也沒有發生過。

httpd服務器的寫入問題是由SELinux引起的。

相關問題