apache / cordova-plugin-file-transfer

Apache Cordova File Transfer Plugin
https://cordova.apache.org/
Apache License 2.0
596 stars 887 forks source link

Allowing chunkedMode to be false on Android with uploads over https #161

Closed Webpal closed 6 years ago

Webpal commented 7 years ago

Platforms affected

Android

What does this PR do?

File uploads over https were automatically turned to Transfer-encoding: chunked due to old Android issues. Since adding this header to transfers often breaks functionality (for example you can't add an additional header to an Amazon S3 request that was signed without it) - isn't it better to follow the users instruction to use chunked mode or not instead of overwriting it?

What testing has been done on this change?

Only deployed on one Android device, can not verify that it doesn't cause OOM issues - but this option is available as a setting for the user to controll in js.

Checklist

cordova-qa commented 7 years ago

Can one of the admins verify this patch?

abihari commented 7 years ago

I ran into this issue while testing my app on an Android device as well. I modified the code similar to this PR and things work like they should. Please don't overwrite the chunkedMode setting that is being passed in from the JS side.

jorgecasas commented 7 years ago

I wasn't able to receive files in a PHP FastCGI server due it did not allowed chunkedMode if you were over HTTPS. With this patch it works now.

hey99xx commented 7 years ago

This can be closed, right? https://github.com/apache/cordova-plugin-file-transfer/commit/655489905ab5bd2600d4eaf80e8dd5d27e96b461

maverickmishra commented 6 years ago

With the new features introduced in XMLHttpRequest, this plugin is not needed any more. Migrating from this plugin to using the new features of XMLHttpRequest, is explained in this Cordova blog post.