Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f51a585

Browse files
committed
Removed unused imports and set chunked streaming mode to upload
connection, to avoid out of memory exceptions when uploading large files. Thanks to @derekentringer for reporting the issue and for testing
1 parent 7f7b2a8 commit f51a585

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/com/alexbbb/uploadservice/UploadService.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
import java.net.URL;
1111
import java.util.ArrayList;
1212

13-
import javax.net.ssl.HostnameVerifier;
14-
import javax.net.ssl.HttpsURLConnection;
15-
import javax.net.ssl.SSLSession;
16-
1713
import android.os.PowerManager;
1814
import android.app.IntentService;
1915
import android.app.NotificationManager;
@@ -219,6 +215,7 @@ private HttpURLConnection getMultipartHttpURLConnection(final String url,
219215
conn.setDoInput(true);
220216
conn.setDoOutput(true);
221217
conn.setUseCaches(false);
218+
conn.setChunkedStreamingMode(0);
222219
conn.setRequestMethod(method);
223220
conn.setRequestProperty("Connection", "Keep-Alive");
224221
conn.setRequestProperty("ENCTYPE", "multipart/form-data");

0 commit comments

Comments
 (0)