Skip to content

Commit

Permalink
Merge pull request #985 from nextcloud/fix/upload-chunk-mtime
Browse files Browse the repository at this point in the history
ChunkedFileRemoteOperation: correctly use lastModificationTimestamp
  • Loading branch information
AlvaroBrey authored Nov 16, 2022
2 parents e39a3c4 + 08b0ac2 commit d2b81dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
String originUri = uploadFolderUri + "/.file";

moveMethod = new MoveMethod(originUri, destinationUri, true);
moveMethod.addRequestHeader(OC_X_OC_MTIME_HEADER, String.valueOf(file.lastModified() / 1000));
moveMethod.addRequestHeader(OC_X_OC_MTIME_HEADER, lastModificationTimestamp);

if (creationTimestamp != null && creationTimestamp > 0) {
moveMethod.addRequestHeader(OC_X_OC_CTIME_HEADER, String.valueOf(creationTimestamp));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public class UploadFileRemoteOperation extends RemoteOperation<String> {
protected String localPath;
protected String remotePath;
protected String mimeType;
private String lastModificationTimestamp;
/**
* Must be in seconds, according to UNIX time
*/
protected String lastModificationTimestamp;
protected Long creationTimestamp = null;
protected boolean disableRetries = false;
PutMethod putMethod = null;
Expand Down

0 comments on commit d2b81dd

Please sign in to comment.