The original creator and timestamp of the files changes on copy

  • 1
  • Question
  • Updated 10 months ago
Hi Team,

I am trying to copy the files in a folder to another folder using sharefile api. While doing so , the original creator and its timestamp is overridden with the current timestamp and user details. Is there a way we can retain the old details on copy? Or do you suggest any other API to achieve this ?

Thanks & Regards
Rajitha
Photo of Rajitha

Rajitha

  • 6 Posts
  • 0 Reply Likes

Posted 11 months ago

  • 1
Photo of Dale Smith

Dale Smith, Employee

  • 124 Posts
  • 19 Reply Likes
Hi Rajitha,

Unforuntately those fields get updated because technically you are creating a new item when doing a Copy and they are updated by the system and not any field an API caller can pass in. If you need to keep track of original creator information in your program, you could always use the Metadata endpoint to add custom metadata fields on the file itself after copying.

See: http://api.sharefile.com/rest/docs/resource.aspx?name=Metadata

Hope this helps,
Dale 
Photo of Rajitha

Rajitha

  • 6 Posts
  • 0 Reply Likes
Thanks Dale for the prompt response. 

Can the user see the metadata on the folders?

To be precise we are doing this:
User has an option to go to sharefile via our app and upload files.
Later, due to some actions, we need to copy the files from location (folder A) to location(Folder  B). We are doing this via API using a system credentials as a backend process.

Hence the files in the new folder (B) has the creator as 'system' and new timestamp gets attached.

As suggested by you I tried to update the metadata 'CreatorFirstName' to a new value, but when I log into the sharefile , I still see the creator as 'system'.

Request your assistance if I am doing anythign wrong here.
Please let me know if you need any further details to understand the concern.

Thanks & Regards
Rajitha
Photo of Rajitha

Rajitha

  • 6 Posts
  • 0 Reply Likes
Hi Dale,

Any updates on this?

Thanks
Rajitha
Photo of Dale Smith

Dale Smith, Employee

  • 124 Posts
  • 19 Reply Likes
Hi Rajitha,

No the meta data is not visible within the web app. I was under the assumption you needed the information in your app and that is what the meta data workaround would provide, the ability for your app to get the original creator information. Unfortunately there is no way to have the original creator information available in the web app using your flow of having a system user copying the files. This data is provided solely by the user currently authorizing the api call and not by the api call body itself.

The only thing we do allow for the client to set is the ClientCreatedDateUtc/ClientModifiedDateUtc during the Upload (so you could download and then upload rather than copy), but this still doesn't allow you to set user information.

Here is the information on that from the api documentation site:

clientCreatedDateUTC: DateTime - client filesystem Created Date of this Item. "ClientCreatedDate" is used instead if the parameters are passed through the POST Request body.

clientModifiedDateUTC: DateTime - client filesystem Modified Date of this Item. "ClientModifiedDate" is used instead if the parameters are passed through the POST Request body.
http://api.sharefile.com/rest/docs/resource.aspx?name=Items


Please let us know if there is anything else we can help with,
Dale Smith