X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/548fc80ea1482beb72b94a08b3df02149091c6e7..53585e240098ac4218688d6e1ecfefdbe1512566:/src/eu/alefzero/owncloud/Uploader.java?ds=sidebyside diff --git a/src/eu/alefzero/owncloud/Uploader.java b/src/eu/alefzero/owncloud/Uploader.java index a63010a6..13b2269e 100644 --- a/src/eu/alefzero/owncloud/Uploader.java +++ b/src/eu/alefzero/owncloud/Uploader.java @@ -18,6 +18,7 @@ package eu.alefzero.owncloud; import java.io.File; +import java.net.URLEncoder; import java.util.ArrayList; import java.util.Stack; @@ -264,7 +265,10 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro } Log.d(TAG, "Uploading file to dir " + pathToUpload); - mUploadPath = pathToUpload; + mUploadPath = ""; + for (String s : pathToUpload.split("/")) + mUploadPath = "/" + URLEncoder.encode(s); + if (!mUploadPath.endsWith("/")) mUploadPath += "/"; mCreateDir = false; uploadFiles(); @@ -358,7 +362,7 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro WebdavClient wdc = new WebdavClient(oc_uri); wdc.setCredentials(mUsername, mPassword); - wdc.allowUnsignedCertificates(); + wdc.allowSelfsignedCertificates(); // create last directory in path if nessesary if (mCreateDir) { @@ -382,11 +386,11 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro final String display_name = c.getString(c.getColumnIndex(Media.DISPLAY_NAME)), data = c.getString(c.getColumnIndex(Media.DATA)); local[i] = data; - remote[i] = mUploadPath + "/" + display_name; + remote[i] = mUploadPath + display_name; } else if (uri.getScheme().equals("file")) { final File file = new File(Uri.decode(uri.toString()).replace(uri.getScheme() + "://", "")); local[i] = file.getAbsolutePath(); - remote[i] = mUploadPath + "/" + file.getName(); + remote[i] = mUploadPath + file.getName(); } }