CB-6494 android: Fix upload of KitKat content URIs

FileTransfer was double-decoding the source URL.
This commit is contained in:
Andrew Grieve
2014-04-22 22:16:53 -04:00
parent eb63c466e8
commit 98e5da556f
+1 -8
View File
@@ -28,10 +28,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.net.URLDecoder;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.HashMap;
@@ -177,12 +175,7 @@ public class FileTransfer extends CordovaPlugin {
String target = args.getString(1);
if (action.equals("upload")) {
try {
source = URLDecoder.decode(source, "UTF-8");
upload(source, target, args, callbackContext);
} catch (UnsupportedEncodingException e) {
callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error."));
}
upload(source, target, args, callbackContext);
} else {
download(source, target, args, callbackContext);
}