Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7AFFED738 for ; Mon, 29 Oct 2012 21:18:12 +0000 (UTC) Received: (qmail 65318 invoked by uid 500); 29 Oct 2012 21:18:12 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 65287 invoked by uid 500); 29 Oct 2012 21:18:12 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 65278 invoked by uid 500); 29 Oct 2012 21:18:12 -0000 Delivered-To: apmail-incubator-callback-dev@incubator.apache.org Received: (qmail 65275 invoked by uid 99); 29 Oct 2012 21:18:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Oct 2012 21:18:12 +0000 Date: Mon, 29 Oct 2012 21:18:12 +0000 (UTC) From: "Andrew Grieve (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1330749612.40961.1351545492253.JavaMail.jiratomcat@arcas> In-Reply-To: <1312188443.40295.1351537692734.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CB-1753) Some web servers generate a 503 error with FileTransfer.upload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-1753?page=3Dcom.atlassian.ji= ra.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1348637= 4#comment-13486374 ]=20 Andrew Grieve commented on CB-1753: ----------------------------------- Also note that there were some fixes to FileTransfer in 2.0. It's possible = that just updating your Cordova version would fix the problem. =20 > Some web servers generate a 503 error with FileTransfer.upload > -------------------------------------------------------------- > > Key: CB-1753 > URL: https://issues.apache.org/jira/browse/CB-1753 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 1.9.0 > Environment: Client: Galaxy Nexus running 4.0.3 > Server: Nginx/Varnish/PHP 5.3.x (I can get the software versions from the= admin) > Reporter: Ronald Partridge > Assignee: Joe Bowser > Fix For: Master > > > See: > https://github.com/apache/incubator-cordova-android/blob/master/framework= /src/org/apache/cordova/FileTransfer.java > private void upload(final String source, final String target, JSONArray a= rgs, CallbackContext callbackContext) > Cordova Android may have a bug with the way files are being sent. The And= roid source code appears to use the built in java HttpURLConnection and > the developer who wrote the functionality decided to write the logic to a= ssemble the post data to be transfered. I examined two different post dumps > being sent to a web server running Nginx and Varnish. Notice how the head= ers are different between iOS and Android. > I would suggest using http://hc.apache.org/httpcomponents-client-ga/httpc= lient/apidocs/org/apache/http/impl/client/DefaultHttpClient.html > Here are the two post dumps: > Android: > POST /service/claim/photo/75?api_key=3D123ab > c HTTP/1.1 > Connection: Keep-Alive > Content-Type: multipart/form-data;boundary=3D***** > User-Agent: Dalvik/1.6.0 (Linux; U; Android 4.1.1; Nexus S Build/JRO03E) > Host: sit.service.app.mydomain.ca > Accept-Encoding: gzip > Transfer-Encoding: chunked > o<8A>P9)^B^@6^@^@^@6^@^@^@^@^@^L^G^@PV<8E>^A^@E^@^@(e@^@@= ^FESC^_[&c<88>^@P%&<9C>W=C4=98P^P^Y ^^@^@o<= 8A>P<93>,^B^@^D^@ > ^@^D^@^@^@^@^L^G^@PV<8E>^A^@E^@^Df@^@@^F:ESC^= _[&c<88>^@P%&<9C>W=C4=98P^X^Y ^?I^@^@HTTP/1.1 503 Servi= ce Unavailable > Server: Varnish > Content-Type: text/html; charset=3Dutf-8 > Content-Length: 932 > Accept-Ranges: bytes > Date: Fri, 26 Oct 2012 20:15:43 GMT > X-Varnish: 409357173 > Age: 0 > Via: 1.1 varnish > Connection: close > X-Cache: MISS > iOS: > POST /service/claim/photo/73?api_key=3D123abc HTTP/1.1 > Host: sit.service.app.mydomain.ca > User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) Apple= WebKit/534.46 (KHTML, like Gecko) Mobile/9B206 > Content-Length: 139038 > Accept: */* > Content-Type: multipart/form-data; boundary=3D*****org.apache.cordova.for= mBoundary > X-Requested-With: XMLHttpRequest > Accept-Language: en-us > Accept-Encoding: gzip, deflate > Connection: keep-alive > 4<8A>P;^F^A^@6^@^@^@6^@^@^@^@^@^L^G^@PV<8E>^A^@E^@^@(}1@^@@^F= C^SESC^_[&c<88>^@P<8F>^^^_P^P^Y ^X`^@^@4<8A>P^K^A^@ > <9A>^E^@^@<9A>^E^@^@^@PV<8E>^A:^@^U~^Z^H^@E^@^E<8C>C@^@)^F<9C>&c<88>ESC^_[<8F>^@P^^^_P^P= ^@^@--*****org.apache.cordova.formBoundary > Content-Disposition: form-data; name=3D"description" > Photo > --*****org.apache.cordova.formBoundary > Content-Disposition: form-data; name=3D"userfile"; filename=3D"cdv_photo_= 002.jpg" > Content-Type: image/jpeg > Content-Length: 138722 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira