IStorageFile IStorageFile IStorageFile IStorageFile IStorageFile Interface

Definition

Represents a file. Provides information about the file and its contents, and ways to manipulate them.

Important

If you simply want to work with files in your app, see the StorageFile class.

public : interface IStorageFile : IStorageItem, IInputStreamReference, IRandomAccessStreamReference
struct winrt::Windows::Storage::IStorageFile : IStorageItem, IInputStreamReference, IRandomAccessStreamReference
public interface IStorageFile : IStorageItem, IInputStreamReference, IRandomAccessStreamReference
Public Interface IStorageFile Implements IStorageItem, IInputStreamReference, IRandomAccessStreamReference
// You can't instantiate an interface directly in JavaScript. You can use objects that implement the interface, however.
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
musicLibrary picturesLibrary videosLibrary documentsLibrary

Properties

Attributes Attributes Attributes Attributes Attributes

Gets the attributes of a storage item.

(Inherited from IStorageItem)
ContentType ContentType ContentType ContentType ContentType

Gets the MIME type of the contents of the file.

DateCreated DateCreated DateCreated DateCreated DateCreated

Gets the date and time when the current item was created.

(Inherited from IStorageItem)
FileType FileType FileType FileType FileType

Gets the type (file name extension) of the file.

Name Name Name Name Name

Gets the name of the item including the file name extension if there is one.

(Inherited from IStorageItem)
Path Path Path Path Path

Gets the full file-system path of the item, if the item has a path.

(Inherited from IStorageItem)

Methods

CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile)

Replaces the specified file with a copy of the current file.

CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder)

Creates a copy of the file in the specified folder.

CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String)

Creates a copy of the file in the specified folder, using the desired name.

CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption)

Creates a copy of the file in the specified folder, using the desired name. This method also specifies what to do if an existing file in the specified folder has the same name.

DeleteAsync DeleteAsync DeleteAsync DeleteAsync DeleteAsync

Deletes the current item.

(Inherited from IStorageItem)
DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption)

Deletes the current item, optionally deleting it permanently.

(Inherited from IStorageItem)
GetBasicPropertiesAsync GetBasicPropertiesAsync GetBasicPropertiesAsync GetBasicPropertiesAsync GetBasicPropertiesAsync

Gets the basic properties of the current item (like a file or folder).

(Inherited from IStorageItem)
IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes)

Determines whether the current IStorageItem matches the specified StorageItemTypes value.

(Inherited from IStorageItem)
MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile)

Moves the current file to the location of the specified file and replaces the specified file in that location.

MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder)

Moves the current file to the specified folder.

MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String)

Moves the current file to the specified folder and renames the file according to the desired name.

MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption)

Moves the current file to the specified folder and renames the file according to the desired name. This method also specifies what to do if a file with the same name already exists in the specified folder.

OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode)

Opens a random-access stream over the file.

OpenReadAsync OpenReadAsync OpenReadAsync OpenReadAsync OpenReadAsync

Opens a stream for random access.

(Inherited from IRandomAccessStreamReference)
OpenSequentialReadAsync OpenSequentialReadAsync OpenSequentialReadAsync OpenSequentialReadAsync OpenSequentialReadAsync

Opens a stream for sequential read access.

(Inherited from IInputStreamReference)
OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync()

Opens a transacted, random-access stream for writing to the file.

RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String)

Renames the current item.

(Inherited from IStorageItem)
RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption) RenameAsync(String,NameCollisionOption)

Renames the current item. This method also specifies what to do if an existing item in the current item's location has the same name.

(Inherited from IStorageItem)

See Also