NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
102 stars 50 forks source link

Cannot upload big file. 50-100+ MB #92

Closed Sharique-Hasan closed 6 years ago

Sharique-Hasan commented 6 years ago

I am unable to upload big files of size 50-100 MB. However I was able to upload a 27 MB video which was of 16 seconds. and 30 seconds video of size 50 MB was failed giving out error java.net.SocketException: Broken pipe. Upload doesn't even starts for heavy videos.

tns info: "nativescript-background-http": "^3.1.0", ┌──────────────────┬─────────────────┬────────────────┬──────────────────┐ │ Component │ Current version │ Latest version │ Information │ │ nativescript │ 3.3.0 │ 3.4.0 │ Update available │ │ tns-core-modules │ 3.3.0 │ 3.4.0 │ Update available │ │ tns-android │ 3.2.0 │ 3.4.0 │ Update available │ │ tns-ios │ 3.3.0 │ 3.4.0 │ Update available │ └──────────────────┴─────────────────┴────────────────┴──────────────────┘

Sample app: https://github.com/mrazahasan/imagePicker. My app has already hit the production and this error came in production app. Some quick solution would be appreciated.

tgpetrov commented 6 years ago

Hi @Sharique-Hasan

This exception indicates that while the data was being sent from the client to the server, the server has closed the connection. The connection can be closed due to different reasons - for example if the server has crashed or if it has a maximum POST size set and the current upload has reached this limit. In order to confirm that the issue is in the server and not in the plugin, I used you app as it is and when I tried to upload a large file, I reproduced the mentioned exception. However, when I changed the server url from httpbin to requestbin, I was able to successfully upload a 55MB video.