質問

I'm trying to set X-Delete-After and X-Delete-At to a file i'm uploading.

So i tired :

FileMetaData.Add("X-Delete-After", "30");
cloudFilesProvider.UpdateObjectMetadata(inStrContainerID, strDesFileName, FileMetaData);

but the header did not get recognized.

is that the right approach?

Edit: I'm trying to use ICloudFilesMetadataProcessor.ProcessMetadata, but really have no clue how to and am not able to find any documentation.

役に立ちましたか?

解決

In the current release of the SDK, you can include the X-Delete-After or X-Delete-At value in the headers argument to the following calls:

  1. IObjectStorageProvider.CreateObject
  2. IObjectStorageProvider.CreateObjectFromFile

Currently there is no way in the SDK to change the value of this header after the file has already been uploaded (e.g. using UpdateObjectMetadata as you suggest in the question would set the values X-Object-Meta-X-Delete-After or X-Object-Meta-X-Delete-After, which is not correct).

Here is a related issue on GitHub:
#167: How to assign version folder

他のヒント

Gopstar --

EDITED:

After more investigation; I set the X-Delete-After to 1500 and the code worked. Sort of. When viewing the file header information via the dashboard, the X-Delete-At was set.

However, the result was correct; the X-Delete-At was equal to what would be 1500 seconds from the time I set it.

Original reply:

I played around; if you set the value higher (for example, I tried X-Delete-After = 3000) it will work.

I do NOT know the lowest number acceptable, but I'm sure someone will chime in with the number.

Hope this give SOME help.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top