Access Denied in Document Folders.

  • Thread starter Thread starter WPCentral Question
  • Start date 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
 
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.
 

Members online

No members online now.

Forum statistics

Threads
332,610
Messages
2,255,558
Members
428,713
Latest member
nick rajesj