I have developed a Metro app. I have a page that saves the user's selected image. When I choose the image in the pictures folder, an error will occur:
Error HRESULT E_FAIL has been returned from a call to a COM component
But if I choose from another folder, everything will proceed smoothly and save the image name into the database.
Here is the snippet:
if (file != null)
{
StorageFolder documentsFolder = KnownFolders.PicturesLibrary;
output = await file.CopyAsync(documentsFolder,
file.Name.ToString(),
NameCollisionOption.ReplaceExisting);
}