[Owncloud] Setting the Last Modified Date (Sync/Backup)

Klaas Freitag freitag at owncloud.com
Tue Jun 19 15:33:34 UTC 2012


On 19.06.2012 17:22, Rob Oakes wrote:
Hi Rob,

>
> As  a quick way of introduction, my name is Rob Oakes. I'm writing for two reasons:
>
> First, I wanted to say thank you for developing a wonderful piece of software. I've just started using ownCloud to manage my business calendar, contacts, and files and I absolutely love it. It meets every need that I have in a well designed and elegant manner, and it is open source. I can't wait to see where it will be headed in the near future.
>
> The second reason I am writing is with a development question. Because I see a great deal of promise in ownCloud, I am very eager to begin adding support for its various features to some of the software products my company develops. As a test case, I wanted to add it to a backup client called "Time Drive" that I develop/maintain (https://launchpad.net/time-drive). In the process of writing an ownCloud specific backend, though, I've come across a problem I can't figure out the solution to:
>
> Whenever I upload files to the web server through a "PUT" command, I find that I am unable to change the "Last-Modified" ('getlastmodified' in WebDav) property. Putting 'Last-Modified' into the header with the proper value is ignored. As is every other header I can think of ('lastmodified', 'getlastmodified', 'setlastmodified', 'Modified-Last', etc.)
>
> I've also tried to change the last-modified time using a PROPPATCH request, also to no avail.
Hmm, it's a PROPPATCH request on the file resource, with property name 
'lastmodified' and the time as UTC epoch value. That should work. The 
line you pointed out does it for the csync ownCloud module.

>
> By looking at the source code for sync (http://git.csync.org/users/freitag/csync.git/tree/modules/csync_owncloud.c?h=dav, line 1423) and through the archives of the mailing list (http://www.mail-archive.com/owncloud@kde.org/msg01793.html), it seems that ownCloud supports the modification of the 'Last-Modified' property. (This is how the ownCloud csync backend works, right?)
That's right. Csync works on times and modifies it that way.

have fun,

Klaas




More information about the Owncloud mailing list