Skip to content

Commit

Permalink
Merge pull request #3377 from owncloud/upload-send-mtime
Browse files Browse the repository at this point in the history
Send mtime with uploads
  • Loading branch information
Vincent Petry authored May 26, 2020
2 parents 4c9e036 + 2cb8266 commit ad7f868
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/files/src/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,15 @@ export default {
})
})
} else {
const extraHeaders = {}
if (file.lastModifiedDate) {
extraHeaders['X-OC-Mtime'] = '' + file.lastModifiedDate.getTime() / 1000
} else if (file.lastModified) {
extraHeaders['X-OC-Mtime'] = '' + file.lastModified / 1000
}
promise = this.uploadQueue.add(() =>
this.$client.files.putFileContents(relativePath, file, {
headers: extraHeaders,
onProgress: progress => {
this.$_ocUpload_onProgress(progress, file)
},
Expand Down
9 changes: 9 additions & 0 deletions changelog/unreleased/3377
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: Send mtime with uploads

When uploading a file, the modification time is now sent along.
This means that the uploaded file will have the same modification time
like the one it had on disk.
This aligns the behavior with the desktop client which also keeps the mtime.

https://github.com/owncloud/phoenix/issues/2969
https://github.com/owncloud/phoenix/pull/3377

0 comments on commit ad7f868

Please sign in to comment.