diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index f3b5bf3fd2..65b5fd08c9 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -660,7 +660,7 @@ public class FileUploader extends Service UploadFileOperation upload = removeResult.first; if (upload == null && mCurrentUpload != null && mCurrentAccount != null && - remotePath.contains(mCurrentUpload.getFileName()) && + mCurrentUpload.getRemotePath().startsWith(remotePath) && accountName.equals(mCurrentAccount.name)) { upload = mCurrentUpload; diff --git a/src/com/owncloud/android/operations/UploadFileOperation.java b/src/com/owncloud/android/operations/UploadFileOperation.java index 33bc0febd3..042fdbecbd 100644 --- a/src/com/owncloud/android/operations/UploadFileOperation.java +++ b/src/com/owncloud/android/operations/UploadFileOperation.java @@ -26,6 +26,7 @@ import android.net.Uri; import com.owncloud.android.datamodel.FileDataStorageManager; import com.owncloud.android.datamodel.OCFile; +import com.owncloud.android.datamodel.UploadsStorageManager; import com.owncloud.android.db.OCUpload; import com.owncloud.android.files.services.FileUploader; import com.owncloud.android.lib.common.OwnCloudClient; @@ -363,6 +364,9 @@ public class UploadFileOperation extends SyncOperation { createNewOCFile(remotePath); Log_OC.d(TAG, "File renamed as " + remotePath); } + mRemotePath = remotePath; + UploadsStorageManager usm = new UploadsStorageManager(mContext.getContentResolver()); + usm.updateDatabaseUploadStart(this); } if (mCancellationRequested.get()) {