From 87b81e53f00dcd93ebdbdf2f4bdb0c6d950f4f1a Mon Sep 17 00:00:00 2001 From: macdonst Date: Thu, 28 Jun 2012 11:57:06 -0400 Subject: [PATCH] CB-978: FileTransfer.upload from a directory with a space fails --- framework/src/org/apache/cordova/FileTransfer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/src/org/apache/cordova/FileTransfer.java b/framework/src/org/apache/cordova/FileTransfer.java index 824ad020..2b2620ba 100644 --- a/framework/src/org/apache/cordova/FileTransfer.java +++ b/framework/src/org/apache/cordova/FileTransfer.java @@ -29,6 +29,7 @@ import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; +import java.net.URLDecoder; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.Iterator; @@ -73,7 +74,7 @@ public class FileTransfer extends Plugin { String source = null; String target = null; try { - source = args.getString(0); + source = URLDecoder.decode(args.getString(0)); target = args.getString(1); } catch (JSONException e) { Log.d(LOG_TAG, "Missing source or target"); @@ -321,7 +322,7 @@ public class FileTransfer extends Plugin { } catch (Throwable t) { // Shouldn't happen, but will JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn); - Log.wtf(LOG_TAG, error.toString(), t); + Log.e(LOG_TAG, error.toString(), t); return new PluginResult(PluginResult.Status.IO_EXCEPTION, error); } finally { if (conn != null) {