浏览代码

immediately show correct infos about uploaded file

tobiasKaminsky 7 年之前
父节点
当前提交
f175706ab0
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/main/java/com/owncloud/android/operations/UploadFileOperation.java

+ 9 - 1
src/main/java/com/owncloud/android/operations/UploadFileOperation.java

@@ -1346,7 +1346,15 @@ public class UploadFileOperation extends SyncOperation {
         // in theory, should return the same we already have
         // TODO from the appropriate OC server version, get data from last PUT response headers, instead
         // TODO     of a new PROPFIND; the latter may fail, specially for chunked uploads
-        ReadRemoteFileOperation operation = new ReadRemoteFileOperation(getRemotePath());
+        String path;
+        OCFile parent = getStorageManager().getFileByPath(file.getParentRemotePath());
+        if (parent.isEncrypted()) {
+            path = file.getParentRemotePath() + mFile.getEncryptedFileName();
+        } else {
+            path = getRemotePath();
+        }
+
+        ReadRemoteFileOperation operation = new ReadRemoteFileOperation(path);
         RemoteOperationResult result = operation.execute(client);
         if (result.isSuccess()) {
             updateOCFile(file, (RemoteFile) result.getData().get(0));