Vladimir Gondarev
Vladimir Gondarev

Reputation: 1243

Onedrive, store custom properties/attribute within a file

Is there a way to store custom properties within a file I upload? i.e. I need a simple way to store a metadata for the files I upload.

The only way I found is, to store the data in the "description" property, like:

string id = await FetchFileId(fileName);
var fileData = new Dictionary<string, object>();
fileData.Add("description", "here goes json data or something similar");            
LiveOperationResult operationResult = await client.PutAsync(id, fileData);

Is there a better way?

Upvotes: 0

Views: 511

Answers (1)

daspek
daspek

Reputation: 1474

Unfortunately there's no supported way to set custom metadata right now. We don't recommend using the 'description' property for that, either, as it's meant to be a human-readable description that's displayed in OneDrive apps.

Upvotes: 2

Related Questions