You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Wouter (Created) (JIRA)" <ji...@apache.org> on 2012/04/12 16:15:16 UTC

[jira] [Created] (CB-488) FileTransfer.upload does not follow redirects on Android

FileTransfer.upload does not follow redirects on Android
--------------------------------------------------------

                 Key: CB-488
                 URL: https://issues.apache.org/jira/browse/CB-488
             Project: Apache Callback
          Issue Type: Bug
          Components: CordovaJS
    Affects Versions: 1.5.0, 1.4.0, 1.3.0
         Environment: Andoid device: Samsung Galaxy S Plus
            Reporter: Wouter
            Assignee: Filip Maj


We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)

Steps to reproduce:
- Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
- The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.

Actual Result:
- In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).

Expected Result:
- The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
Or (but lower preference):
- The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Wouter (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253397#comment-13253397 ] 

Wouter commented on CB-488:
---------------------------

Thank you for the jar and js, but unfortunately these do not resolve this issue...
I still get the same result: the redirect is not followed.

Do you have another idea how to solve this issue?
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Wouter (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13255427#comment-13255427 ] 

Wouter commented on CB-488:
---------------------------

I tried uploading to http and still redirecting to http, so no protocol change. This doe not make a difference: the redirect still is not followed.
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Wouter (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253453#comment-13253453 ] 

Wouter commented on CB-488:
---------------------------

Ok, I hope another solution is possible...

And yes, the upload to Youtube is https, the redirect is to http.
Do you think it will make a difference if the protocols are the same? If so then perhaps we can ttry that (but that will be next week).
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Joe Bowser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484517#comment-13484517 ] 

Joe Bowser commented on CB-488:
-------------------------------

What's the status of this issue?  It doesn't look like it's been touched in months.
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>             Fix For: Master
>
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Wouter (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253192#comment-13253192 ] 

Wouter commented on CB-488:
---------------------------

Great that a solution is found so quickly.

But no I cannot build the PhoneGap source, so a jar and js would be helpful. I presume this build will be based on the last version of PhoneGap (1.6.0)?

And will this fix also be included in the next versioin(s) of PhoneGap?

Thank you!

                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Simon MacDonald (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253411#comment-13253411 ] 

Simon MacDonald commented on CB-488:
------------------------------------

Not yet. That was the first thing that jumped out at me. Out of
curiosity is the upload switching from HTTP to HTTPS or vice versa?

Simon Mac Donald
http://hi.im/simonmacdonald



On Fri, Apr 13, 2012 at 10:12 AM, Wouter (Commented) (JIRA)

                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Simon MacDonald (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253374#comment-13253374 ] 

Simon MacDonald commented on CB-488:
------------------------------------

No, I'm not sure :) I will send you a jar/js combo to test via email.

                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Filip Maj (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filip Maj updated CB-488:
-------------------------

      Component/s:     (was: CordovaJS)
                   Android
    Fix Version/s: Master

Updating component to Android. Setting to master as a confirmed issue.
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>             Fix For: Master
>
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Simon MacDonald (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon MacDonald reassigned CB-488:
----------------------------------

    Assignee: Simon MacDonald  (was: Filip Maj)
    
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Saurabh Kr Singh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423956#comment-13423956 ] 

Saurabh Kr Singh commented on CB-488:
-------------------------------------

Wild guess :Can url whitelist be the culprit ?
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>             Fix For: Master
>
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Wouter (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13253353#comment-13253353 ] 

Wouter commented on CB-488:
---------------------------

>From what I understand of the java documentation it looks like the default value of that instanceFollowRedirects is already true, but I am not too familiar with java. Therefor just asking: are you sure this will be the solution?
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484650#comment-13484650 ] 

Simon MacDonald commented on CB-488:
------------------------------------

I parked it due to the talk about super-ceding FileTransfer with XHR2. 
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>             Fix For: Master
>
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-488) FileTransfer.upload does not follow redirects on Android

Posted by "Simon MacDonald (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13252490#comment-13252490 ] 

Simon MacDonald commented on CB-488:
------------------------------------

This is a pretty simple fix. Can you build the PhoneGap source? If so I can tell you that you need to add:

    conn.setInstanceFollowRedirects(true);

In the upload method. If you can't build the src I can send you a .jar/.js for testing.
                
> FileTransfer.upload does not follow redirects on Android
> --------------------------------------------------------
>
>                 Key: CB-488
>                 URL: https://issues.apache.org/jira/browse/CB-488
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: CordovaJS
>    Affects Versions: 1.3.0, 1.4.0, 1.5.0
>         Environment: Andoid device: Samsung Galaxy S Plus
>            Reporter: Wouter
>            Assignee: Simon MacDonald
>
> We are trying to upload a local move file to Youtube though the Youtube API. This API works in such a way that after uploading a file a redirect is done to another location. Unfortunately the Android implementation of FileTransfer does not follow this redirect. (The iPhone implementation does follow the redirect.)
> Steps to reproduce:
> - Create a FileTransfer instance and call the upload method following the example at http://docs.phonegap.com/en/1.6.0/cordova_file_file.md.html#FileTransfer
> - The server the file is posted to (in the sample this is http://some.server.com/upload.php) should do a redirect to another location to reproduce this issue.
> Actual Result:
> - In the success callback the FileUploadResult.responseCode is 302, and the FileUploadResult.response is "Temporarily Moved" (or similar depending on the webserver that responded with the redirect).
> Expected Result:
> - The redirect is followed and the result of the new location is retreived and represented in the FileUploadResult instance.
> Or (but lower preference):
> - The FileUploadResult instance also contains the HTTP headers that were sent with the response so that the Location header (containging the url to redirect to) is known.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira