diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index bc873eddc6..3b56e0f658 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -493,6 +493,7 @@ public class FileUploader extends Service newUpload = new UploadFileOperation( account, + files[i], ocUpload, chunked, forceOverwrite, @@ -546,6 +547,7 @@ public class FileUploader extends Service UploadFileOperation newUpload = new UploadFileOperation( account, + null, upload, chunked, upload.isForceOverwrite(), // TODO should be read from DB? diff --git a/src/com/owncloud/android/operations/UploadFileOperation.java b/src/com/owncloud/android/operations/UploadFileOperation.java index 81703086c3..c872e95b19 100644 --- a/src/com/owncloud/android/operations/UploadFileOperation.java +++ b/src/com/owncloud/android/operations/UploadFileOperation.java @@ -138,6 +138,7 @@ public class UploadFileOperation extends SyncOperation { protected RequestEntity mEntity = null; public UploadFileOperation(Account account, + OCFile file, OCUpload upload, boolean chunked, boolean forceOverwrite, @@ -156,11 +157,15 @@ public class UploadFileOperation extends SyncOperation { } mAccount = account; - mFile = obtainNewOCFileToUpload( - upload.getRemotePath(), - upload.getLocalPath(), - upload.getMimeType() - ); + if (file == null) { + mFile = obtainNewOCFileToUpload( + upload.getRemotePath(), + upload.getLocalPath(), + upload.getMimeType() + ); + } else { + mFile = file; + } mRemotePath = upload.getRemotePath(); mChunked = chunked; mForceOverwrite = forceOverwrite;