Skip to content

Commit

Permalink
Removed unused imports and set chunked streaming mode to upload
Browse files Browse the repository at this point in the history
connection, to avoid out of memory exceptions when uploading large
files. Thanks to @derekentringer for reporting the issue and for testing
  • Loading branch information
gotev committed Jun 23, 2014
1 parent 7f7b2a8 commit f51a585
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/com/alexbbb/uploadservice/UploadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import java.net.URL;
import java.util.ArrayList;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSession;

import android.os.PowerManager;
import android.app.IntentService;
import android.app.NotificationManager;
Expand Down Expand Up @@ -219,6 +215,7 @@ private HttpURLConnection getMultipartHttpURLConnection(final String url,
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(false);
conn.setChunkedStreamingMode(0);
conn.setRequestMethod(method);
conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("ENCTYPE", "multipart/form-data");
Expand Down

0 comments on commit f51a585

Please sign in to comment.