Properties | properties property
Collapse the table of content
Expand the table of content

StorageFile.Properties | properties property

Gets an object that provides access to the content-related properties of the file.


var properties =;

Property value

Type: StorageItemContentProperties

The object that provides access to the content-related properties of the file.


Note  Properties that are get or set using a property handler that is defined by another app (like Microsoft Word) may not be accessible. Instead, you can try to get these properties using a file query that is backed by the system index. For more information, see QueryOptions.

For more code samples about accessing properties, see the File access sample.


This example demonstrates how to retrieve content properties or specified properties from a file using StorageFile.Properties.

var file = SdkSample.sampleFile;
if (file !== null) {
    var outputDiv = document.getElementById("output");

    // Get image properties (imageProperties) {
        outputDiv.innerHTML += "Date taken: " + imageProperties.dateTaken + "<br />";
        outputDiv.innerHTML += "Rating: " + imageProperties.rating + "<br />";

        // Specify more properties to retrieve
        var dateAccessedProperty = "System.DateAccessed";
        var fileOwnerProperty    = "System.FileOwner";

        // Get the specified properties through
        return[fileOwnerProperty, dateAccessedProperty]);
    }).done(function (extraProperties) {
        var propValue = extraProperties[dateAccessedProperty];
        if (propValue !== null) {
            outputDiv.innerHTML += "Date accessed: " + propValue + "<br />";
        propValue = extraProperties[fileOwnerProperty];
        if (propValue !== null) {
            outputDiv.innerHTML += "File owner: " + propValue;
    // Handle errors with an error function
	   function (error) {
	       // Handle errors encountered while retrieving properties

After GetImagePropertiesAsync completes, imageProperties gets a ImageProperties object. Additionally, after RetrievePropertiesAsync completes, extraProperties gets an object that contains the specified properties.

In the example, file contains a StorageFile that represents the file to retrieve properties for.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Storage [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::Storage [C++]



See also




© 2017 Microsoft