DownloadsFolder.CreateFolderAsync(String, CreationCollisionOption) | createFolderAsync(String, CreationCollisionOption) method

Applies to Windows only

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.

Syntax


Windows.Storage.DownloadsFolder.createFolderAsync(desiredName, option).done( /* Your success and error handlers */ );

Parameters

desiredName

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The desired name of the subfolder to create.

If there is an existing subfolder in the Downloads folder that already has the specified desiredName, the specified CreationCollisionOption determines how Windows responds to the conflict.

option

Type: CreationCollisionOption

The enum value that determines how Windows responds if the desiredName is the same as the name of an existing subfolder in the Downloads folder.

Because the app can only access folders in the Downloads folder that it created, you can't specify OpenIfExists or ReplaceExisting for this parameter.

Return value

Type: IAsyncOperation<StorageFolder>

When this method completes, it returns the new subfolder as a StorageFolder.

Remarks

All apps automatically have permission to create subfolders in the Downloads folder. No capability is needed. Learn more about capabilities in Access to user resources using the Windows Runtime.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

See also

DownloadsFolder
CreateFolderAsync(String)

 

 

Show:
© 2014 Microsoft