Skip to content

Commit 5d84093

Browse files
mustafa01alitocker
authored andcommitted
Fix OutOfMemoryError when uploading large files in android. Fixes #55 (#57)
Fixed OOM crash while uploading files on devices with limited memory
1 parent c8d370b commit 5d84093

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cloudinary-android/src/main/java/com/cloudinary/android/MultipartUtility.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public MultipartUtility(String requestURL, String charset, String boundary, Map<
4848
URL url = new URL(requestURL);
4949
httpConn = (HttpURLConnection) url.openConnection();
5050
httpConn.setDoOutput(true); // indicates POST method
51+
httpConn.setChunkedStreamingMode(0);
5152
httpConn.setDoInput(true);
5253
if (headers != null) {
5354
for (Map.Entry<String, String> header : headers.entrySet()) {

0 commit comments

Comments
 (0)