Access Denied in Document Folders.

  • Thread starter WPCentral Question
  • Start date
W

WPCentral Question

Hi,

I am trying to copy file from Picture Library folder to Document folder via WP8.1 phone app, however I am getting the Access Denied Exception.
When I tried to copy the file from Picture Library to Camera Roll folder than the file gets copied without any Eroor/Exception.

Below is the code that is giving exception while coping to Document folder:

StorageFolder^ picturesFolder = KnownFolders::DocumentsLibrary;
create_task(file->CopyAsync(picturesFolder, "sample - Copy.dat", NameCollisionOption::ReplaceExisting)).then([this, file](task<StorageFile^> task)
{
try
{
StorageFile^ sampleFileCopy = task.get();
rootPage->NotifyUser("The file '" + file->Name + "' was copied and the new file was named '" + sampleFileCopy->Name + "'.", NotifyType::StatusMessage);
}
catch (COMException^ ex)
{
rootPage->HandleFileNotFoundException(ex);
}
});
}

Actually I need to copy the folder present in Picture Library to the Document Folder. Kindly assist.

Thanks,
Deepak
 

badr0b0t

New member
Jun 27, 2014
238
0
0
Visit site
I think, the problem is that you are trying to copy a jpeg or png files to a folder that should only contain .docx or .xlsx files. Not sure but could be possible.
 

Staff online

Members online

Forum statistics

Threads
323,252
Messages
2,243,527
Members
428,050
Latest member
lolz1234