android icon indicating copy to clipboard operation
android copied to clipboard

Keep modification date of original file

Open woolclew opened this issue 3 years ago • 10 comments

Description

After uploading a file into a cryptomator tresor the timestamp of the file is set to the current timestamp. For uploading I use the Add-button (+) in the cryptomator app.

System Setup

  • Android version: 10
  • Cryptomator version: 1.5.10
  • Cloud type: WebDAV

Steps to Reproduce

  1. Inside a tresor press the Add-Button (+) and choose the option 'Datei hochladen'
  2. Select the file to upload inside the tresor

and

  1. Select a file in the vault
  2. Choose export

Expected Behavior

File is shown with the origin timestamp of the file.

Actual Behavior

File is shown with the current timestamp.

Reproducibility

Always

Additional Information

I use a webdav connection from strato hidrive. With the original app from strato it works like expected: After uploading a file into the the hidrive cloud (without cryptomator) the origin timestamp is used.

The same applies when a file is exported to the local storage of the device. If possible, the modification date should be preserved.

woolclew avatar Dec 23 '20 14:12 woolclew

This bug report did ignore our issue template. 😞 Auto-closing this issue, since it is most likely not useful.

This decision was made by a bot. If you think the bot is wrong, let us know and we'll reopen this issue.

github-actions[bot] avatar Dec 23 '20 14:12 github-actions[bot]

Thanks for this report.

There is already a related issue in our iOS-repo which provides some more information about the difficulties, see https://github.com/cryptomator/cryptomator-ios/issues/26

TLDR; This will be a Cloud-API specific implementation because not all APIs does support setting the creation/modification date.

SailReal avatar Jan 11 '21 09:01 SailReal

TLDR; This will be a Cloud-API specific implementation because not all APIs does support setting the creation/modification date.

@SailReal at the moment which Cloud-API provides this feature? Thanks in advance

JustFanta01 avatar Oct 08 '22 13:10 JustFanta01

@JustFanta01 currently this is not implemented for any cloud. Or was the question for which cloud it is possible to implement?

SailReal avatar Oct 11 '22 09:10 SailReal

@SailReal Yes, I meant the second question.

JustFanta01 avatar Oct 29 '22 17:10 JustFanta01

Sorry for the late response. This should be possible to implement for

  • Dropbox
  • pCloud
  • WebDAV depending on the server application
  • GDrive and https://developers.google.com/drive/api/v2/reference/files/update
  • OneDrive

Clouds that do not support providing the modification date

@JustFanta01 are you willing to implement it?

SailReal avatar Nov 14 '22 12:11 SailReal

@mawi675lr81 @Chistex @woolclew @ghost @zwentastic @sjgriffiths @wu4339 @emilsenan @philthynz @uhLydn @myns23 @joelcieslar @jwsp1 @serialpotato @a-rekkusu @Shihabus-Sakib-Rad @T81 @MTH607 @LearningAsIGo71 @skariko @iam0day @eylenburg

Hi everyone, you are all the people who have commented or opened issues about the implementation of two fundamental features in my opinion:

  1. uploading photos preserving the date and not putting the current one
  2. grid view of the photos to at least understand which photos I have, the filename is useless

Since they are not in the priorities of the developers, I ask you if, in the name of the open source philosophy, can we (or by asking acquaintances/friends) be able to implement these features? Obviously for the first point it would be possible to implement this feature only for the clouds that support it but better than nothing.

The closed source competitor (www.boxcryptor.com) already has these features, I have never written code in Kotlin but there's no way we can't implement them! We can't let the cathedral win, the bazaar will win again!

JustFanta01 avatar Nov 24 '22 21:11 JustFanta01

Hey @SailReal 👋 I'm sorry to bother you Any news on this feature?

This one is particularly useful when dealing with photos and the auto-upload. I don't want to take a picture and instantly open the vault to not mess up the date and the chronological timeline.

Three questions:

  1. Is it possible to add a flag in the settings to choose between 'current time' and 'file metadata time'?
  2. A previous post says that some clouds doesn't provide the API to perform such operation, but many others do. Is it possible to implement this feature where is available and show the previous flag accordingly? or you prefer to go hand in hand with all the features on the various clouds?
  3. In particular in the pCloud API, if you set the two optional parameters[*] "mtime" (file modified time) and "ctime" (file created time) in the uploadfile[**] function, it will do the trick or am I missing something?

// [*] https://docs.pcloud.com/methods/file/uploadfile.html // [**] in 'data/src/apiKey/java/org/cryptomator/data/cloud/pcloud/PCloudImpl.kt'

Thanks in advance

JustFanta01 avatar Apr 02 '23 19:04 JustFanta01

Hi @SailReal, I don't know anything about android but I'm trying to implement this very important feature by myself. But I wanted to ask you for some advice because I don't know if it's feasible. The file to be uploaded is taken as a URI, copied to a temporary path and encrypted. The encrypted file will be the one uploaded to the cloud. So basically I should do some sort of cp --preserve=all in this file copy and then edit each cloud's upload to set the last modified date. In case this functionality is not supported I will leave the default Date(). It might work?

JustFanta01 avatar Jun 23 '23 09:06 JustFanta01

Hi @JustFanta01, It would be really awesome if you could implement that! The best place to start is to have a look at https://github.com/cryptomator/android/pull/285, where @bpavot has already made a good start. IMO it should work like that.

Feel free to ping me if you stuck somewhere or need some input.

SailReal avatar Jun 27 '23 14:06 SailReal

Fixed in #528

SailReal avatar Apr 22 '24 17:04 SailReal