Preserving last-modified time stamps on upload with web API

I am using Seafile 10.0.9 PE via docker.

When syncing files via the rather excellent Seafile desktop client (v 9.0.4), I noticed that last-modified timestamps of folders and files are preserved.

When uploading files and folders via the web interface (dragging them into the browser), last-modified timestamps are not preserved. (Some tools like nextcloud are able to capture that metadata on upload via browser.)

Uploading files via rclone to Seafile also doesn’t preserve the last-modified timestamps, although rclone can definitely display Seafile timestamps. Also downloading files via rclone is not preserving the timestamp.

File last-modified times are critical for my work. It would be amazing if Seafile supported capturing last-modified timestamps when using the browser for uploading.

But even more important would be good support for last-modified in rclone, or a similar tool. This will help to migrate data into Seafile, and provides an exit strategy for moving the data out of Seafile if that should ever be needed, including the last-modified information. Maybe the Seafile time, which has worked on a golang backend, can help rclone, which is also written in golang, to support this feature?

At the moment I’m consolidating data for my organization that is spread across a bunch of storage services, from Google Drive to nextcloud. Seafile would be an excellent choice for the organization to have a single an independent file storage service. But if there is no way to move data in and out in large quantities, preserving the timestamps, it will be difficult to make that commitment.

Hello, what do you mean by migrating data into Seafile with reclone?

Sorry for not providing more context! My organization is using different storage management at the moment. We have a bunch of Terabytes and a few million files lying around. rclone https://rclone.org/ is a great tool that supports most storage APIs. It can be used to migrate data in between storage systems reliably. I have used it many times to my satisfaction, but the Seafile integration doesn’t seem to be perfect.

Hello, rclone is a call to the Web API to upload files, so the result is the same as uploading files through a browser. Currently seafile does not upload metadata information about the file when uploading through a browser, so the last-modified is set to the time the file was uploaded. The client is generating the seafile object locally, as it will use the current last-modified information of the file.

@feiniks Thank you for the clarification. I changed the title of the thread to mention the Web API.

There is a corresponding issue on GitHub: https://github.com/haiwen/seafile/issues/1456
" modification and creation dates stripped from files uploaded through API2"

What would be a reasonable route to adding the ability for setting last modified timestamps via the web API?

Perhaps an optional HTTP header with the last modified information could be sent by web clients. Non-compatible backends (older versions of Seafile) could ignore the header, aware backends (new versions of Seafile) could use it to set the last modified time for the uploaded file.

Which components of Seafile would need to be changed to support such a new header? Is this something that would be feasible being added to the CE by community members?

We’ll consider about this feature request. The file server component has to be changed. We may add it in the future.

1 Like

Dear @Jonathan, do you think preservation of last-modified time will be part of the SeaFile roadmap for a future version?