DownloadsFolder DownloadsFolder DownloadsFolder DownloadsFolder DownloadsFolder Class

Definition

Creates files and folders inside the Downloads folder.

public : static class DownloadsFolder
static struct winrt::Windows::Storage::DownloadsFolder
public static class DownloadsFolder
Public Shared Class DownloadsFolder
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

You can create an empty file in the Downloads folder like this:

Windows.Storage.DownloadsFolder.createFileAsync("sample.txt").done(
    function (file) {
        // Process file
    }
);
StorageFile file = await Windows.Storage.DownloadsFolder.CreateFileAsync("sample.txt");
// Process file

After createFileAsync completes, file gets the new file as a StorageFile.

Remarks

This class is static and cannot be instantiated. Call the methods directly instead.

File and folder permissions in the Downloads folder

All apps can create files and folders in the Downloads folder and can access the files that they create. But apps can't access files in the Downloads folder that they didn't create.

When your app creates a file in the Downloads folder, other apps can't interfere with or access your file unless the user explicitly gives the other app access. The user can give another app access to your file by selecting the file from the file picker. Your app can also use the file picker to get access to the files in the Downloads folder that it didn't create. Learn more about opening files with the file picker in Open files and folders with a picker.

Capabilities are not needed to create or access files in the Downloads folder. Learn more about capabilities in App capability declarations.

To learn more about what locations your app can access, see File access permissions.

Methods

CreateFileAsync(String) CreateFileAsync(String) CreateFileAsync(String) CreateFileAsync(String) CreateFileAsync(String)

Creates a new file inside the Downloads folder.

CreateFileAsync(String, CreationCollisionOption) CreateFileAsync(String, CreationCollisionOption) CreateFileAsync(String, CreationCollisionOption) CreateFileAsync(String, CreationCollisionOption) CreateFileAsync(String, CreationCollisionOption)

Creates a new file in the Downloads folder, and specifies what to do if a file with the same name already exists in the Downloads folder.

CreateFileForUserAsync(User, String) CreateFileForUserAsync(User, String) CreateFileForUserAsync(User, String) CreateFileForUserAsync(User, String) CreateFileForUserAsync(User, String)

Creates a new file inside the Downloads folder of a specific User.

CreateFileForUserAsync(User, String, CreationCollisionOption) CreateFileForUserAsync(User, String, CreationCollisionOption) CreateFileForUserAsync(User, String, CreationCollisionOption) CreateFileForUserAsync(User, String, CreationCollisionOption) CreateFileForUserAsync(User, String, CreationCollisionOption)

Creates a new file in the Downloads folder of a specific User, and specifies what to do if a file with the same name already exists in the Downloads folder.

CreateFolderAsync(String) CreateFolderAsync(String) CreateFolderAsync(String) CreateFolderAsync(String) CreateFolderAsync(String)

Creates a new subfolder in the Downloads folder.

CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, CreationCollisionOption) CreateFolderAsync(String, CreationCollisionOption)

Creates a new subfolder in the Downloads folder, and specifies what to do if a subfolder with the same name already exists in the Downloads folder.

CreateFolderForUserAsync(User, String) CreateFolderForUserAsync(User, String) CreateFolderForUserAsync(User, String) CreateFolderForUserAsync(User, String) CreateFolderForUserAsync(User, String)

Creates a new subfolder inside the Downloads folder of a specific User.

CreateFolderForUserAsync(User, String, CreationCollisionOption) CreateFolderForUserAsync(User, String, CreationCollisionOption) CreateFolderForUserAsync(User, String, CreationCollisionOption) CreateFolderForUserAsync(User, String, CreationCollisionOption) CreateFolderForUserAsync(User, String, CreationCollisionOption)

Creates a new subfolder in the Downloads folder of a specific User, and specifies what to do if a subfolder with the same name already exists in the Downloads folder.