I am developing Windows Phone 8.1 Silverlight app,
I am trying to Upload document from my SD card but getting this error.
Access is denied. Exception from HRESULT: 0x80070005
System.UnauthorizedAccessException
I have also added Capability "ID_CAP_REMOVABLE_STORAGE" in WMAppManifest file. But didn't work.
See my code below:
private async void UploadDocument()
{
StorageFolder externalDevices = KnownFolders.RemovableDevices;
StorageFolder sdCard = (await externalDevices.GetFoldersAsync()).FirstOrDefault();
if (sdCard != null)
{
//An SD card is present and the sdCard variable now contains a reference to it
}
else
{
// No SD card is present.
}
}