上传Android手机上的Web服务器上的大文件
问题描述:
我想在我的Android上传的Web服务器上的文件app.Currently我能够从设备,但比这更给了一个内存溢出异常上传5MB左右的文件,也使得应用程序很不稳定。
I want to upload files on a web server in my android app.Currently i am able to upload files around 5mb from the device but more than this gives a outofmemory exception and also makes app very unstable.
我找的使用,我们可以在应用程序的背景加上大尺寸的上传数据的方法。任何教程/ code是高度AP preciated。
i am looking for a method using which we can upload the data in the app background plus of bigger size. Any tutorials/ code is highly appreciated.
先谢谢了。
答
您可能想看看this从发布费奥多尔。
主要的一点是,你需要在分块设置。
The main point is that you need to set on chunking.
例如
connection.setChunkedStreamingMode(chunkSize);