From 89e260a5a1ffa35cf9ff6563fe83883f186e40b2 Mon Sep 17 00:00:00 2001 From: macdonst Date: Tue, 24 Jan 2012 11:23:41 -0500 Subject: [PATCH] CB-199: FileTransfer.download fails on Android 4.0 The download method in FileTransfer was setting the HttpURLConnection.setDoOutput to true. On Android 4.0 this would force the connection to be a POST when what we actually want is a GET. I removed the offending line and tested the fix in 2.1, 2.2, 2.3 and 4.0. --- framework/src/com/phonegap/FileTransfer.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/src/com/phonegap/FileTransfer.java b/framework/src/com/phonegap/FileTransfer.java index 0c3132ff..a75f7684 100644 --- a/framework/src/com/phonegap/FileTransfer.java +++ b/framework/src/com/phonegap/FileTransfer.java @@ -54,7 +54,7 @@ import com.phonegap.api.PluginResult; public class FileTransfer extends Plugin { - private static final String LOG_TAG = "FileUploader"; + private static final String LOG_TAG = "FileTransfer"; private static final String LINE_START = "--"; private static final String LINE_END = "\r\n"; private static final String BOUNDRY = "*****"; @@ -386,7 +386,6 @@ public class FileTransfer extends Plugin { URL url = new URL(source); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); - connection.setDoOutput(true); connection.connect(); Log.d(LOG_TAG, "Download file:" + url);