Phonegap 3.0.0의 최신 버전으로 업그레이드했습니다. 이것은 간헐적 인 업로드 오류 문제를 일으킨 것 같습니다.Phonegap/Cordova FileTransfer - 오류 3 - Android
나는 사진을 업로드하는 간단한 응용 프로그램이 있습니다. 사진을 선택한 다음 업로드를 푸시합니다.
임의로 "오류 코드 3"이 반환됩니다. 이것은 연결 문제를 이해 한 것입니다. 코드에서 업로드 진행 상황을 출력하고 있습니다. 오류는 업로드의 여러 단계에서 임의로 발생합니다.
코드의 기본 버전을 박탈 내가 인해 사실 추가 간헐적 인 성격
- 에 다른 사람들이 내가 관련을 생각하지 않더라도 제안 일을 덮여있다
function getPhoto(source) { navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, destinationType: destinationType.FILE_URI, sourceType: source }); } function onPhotoDataSuccess(img) { imgUrl = img; $('#smallImage').attr('src',imgUrl); } function doUpload() { ft.onprogress = function(progressEvent) { if (progressEvent.lengthComputable) { var perc = Math.floor(progressEvent.loaded/progressEvent.total * 100); $("#status").text("Uploading: " + perc + "%"); } else { if($("#status").text() == "") { $("#status").text("Uploading"); } else { $("#status").text($("#status").text() + "."); } } }; var options = new FileUploadOptions(); options.fileKey="image"; options.fileName=imgUrl.substr(imgUrl.lastIndexOf('/')+1); options.mimeType="image/jpeg"; options.chunkedMode = false; ft.upload(imgUrl, baseURL + "?do_upload", uploadSuccess, uploadFail, options, true); }
입니다 업로드 명령의 끝에서 자체 서명 된 SSL을 사용 가능하게합니다. 어쨌든 SSL을 사용하지 않습니다.
- 는
- 장애인은 누구나가 할 수있는 다른 무엇을 알고 있나요 모드
청크 config.xml 파일에 액세스 원점을 변경?
는 업데이트 :
나는 나에게 준 VD에서 발생하는 오류를 얻을 수 있었다 로그
08-29 15:06:55.172: D/FileTransfer(531): upload content://media/external/images/media/14 to http://exampledomain.com?page=do_upload
08-29 15:06:55.172: D/FileTransfer(531): fileKey: image
08-29 15:06:55.172: D/FileTransfer(531): fileName: 14
08-29 15:06:55.172: D/FileTransfer(531): mimeType: image/jpeg
08-29 15:06:55.172: D/FileTransfer(531): params: {}
08-29 15:06:55.172: D/FileTransfer(531): trustEveryone: true
08-29 15:06:55.172: D/FileTransfer(531): chunkedMode: false
08-29 15:06:55.172: D/FileTransfer(531): headers: null
08-29 15:06:55.172: D/FileTransfer(531): objectId: 1
08-29 15:06:55.172: D/FileTransfer(531): httpMethod: POST
08-29 15:06:55.192: D/FileTransfer(531): Content Length: 15007
08-29 15:06:55.202: D/FileTransfer(531): Sent 15007 of 15007
08-29 15:06:55.202: W/PluginManager(531): THREAD WARNING: exec() call to FileTransfer.upload blocked the main thread for 54ms. Plugin should use CordovaInterface.getThreadPool().
08-29 15:06:55.212: W/FileTransfer(531): Error getting HTTP status code from connection.
08-29 15:06:55.212: W/FileTransfer(531): java.io.EOFException
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.Util.readAsciiLine(Util.java:314)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:301)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:130)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:630)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:385)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:334)
08-29 15:06:55.212: W/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:534)
08-29 15:06:55.212: W/FileTransfer(531): at org.apache.cordova.filetransfer.FileTransfer$3.run(FileTransfer.java:444)
08-29 15:06:55.212: W/FileTransfer(531): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-29 15:06:55.212: W/FileTransfer(531): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-29 15:06:55.212: W/FileTransfer(531): at java.lang.Thread.run(Thread.java:856)
08-29 15:06:55.223: E/FileTransfer(531): {"target":"http:\/\/exampledomain.com\/?page=do_upload","source":"content:\/\/media\/external\/images\/media\/14","http_status":0,"code":3}
08-29 15:06:55.223: E/FileTransfer(531): java.io.EOFException
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.Util.readAsciiLine(Util.java:314)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:301)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:130)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:630)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:385)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:334)
08-29 15:06:55.223: E/FileTransfer(531): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:534)
08-29 15:06:55.223: E/FileTransfer(531): at org.apache.cordova.filetransfer.FileTransfer$3.run(FileTransfer.java:444)
08-29 15:06:55.223: E/FileTransfer(531): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-29 15:06:55.223: E/FileTransfer(531): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-29 15:06:55.223: E/FileTransfer(531): at java.lang.Thread.run(Thread.java:856)
08-29 15:06:55.223: E/FileTransfer(531): Failed after uploading 15007 of 15007 bytes.
업데이트 내가에서 이상 같은 문제로 보이는 발견 코르도바 버그 추적기. https://issues.apache.org/jira/browse/CB-2293#comment-13753360
버전 2.6.0과 동일한 오류가 있습니다. – kzfabi