Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep modification date of original file #239

Closed
woolclew opened this issue Dec 23, 2020 · 11 comments
Closed

Keep modification date of original file #239

woolclew opened this issue Dec 23, 2020 · 11 comments
Labels
type:enhancement Improvements on an existing feature
Milestone

Comments

@woolclew
Copy link

woolclew commented Dec 23, 2020

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 woolclew added the type:bug Something isn't working label Dec 23, 2020
@github-actions

This comment has been minimized.

@SailReal
Copy link
Member

Thanks for this report.

There is already a related issue in our iOS-repo which provides some more information about the difficulties, see cryptomator/cryptomator-ios#26

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

@SailReal SailReal added type:enhancement Improvements on an existing feature and removed type:bug Something isn't working labels Jan 11, 2021
@SailReal SailReal added this to the Backlog milestone Jan 11, 2021
@SailReal SailReal changed the title Wrong file timestamp Keep modification date of original file Jan 11, 2021
@JustFanta01
Copy link
Contributor

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

@SailReal
Copy link
Member

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

@JustFanta01
Copy link
Contributor

@SailReal Yes, I meant the second question.

@SailReal
Copy link
Member

SailReal commented Nov 14, 2022

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

Clouds that do not support providing the modification date

@JustFanta01 are you willing to implement it?

@JustFanta01
Copy link
Contributor

@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
Copy link
Contributor

JustFanta01 commented Apr 2, 2023

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
Copy link
Contributor

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?

@SailReal
Copy link
Member

Hi @JustFanta01, It would be really awesome if you could implement that! The best place to start is to have a look at #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
Copy link
Member

Fixed in #528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Improvements on an existing feature
Projects
None yet
Development

No branches or pull requests

4 participants