mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-04-28 00:02:49 +08:00
CB-6494 android: Fix upload of KitKat content URIs
FileTransfer was double-decoding the source URL.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user