Forum Xamarin.Forms

MoveAsync to LocalStorage folder UWP

bogukrbogukr UAMember ✭✭
edited September 2016 in Xamarin.Forms

Hi. I'm trying to move file from Assets folder of my project to LocalStorage folder. But on the step of moving to LocalStorage I get an "Unauthorized access exception. Access denied". Here is my code:

    StorageFolder storageLocalFolder = ApplicationData.Current.LocalFolder;
    StorageFolder storageAssetsFolder = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(@"Assets\Content");

    File = await storageAssetsFolder.GetFileAsync("testPdf.pdf");
    await File.MoveAsync(StorageLocalFolder, "testPdf.pdf", NameCollisionOption.ReplaceExisting);

After this line I receive exception. What am I doing wrong? Thanks in advance

Answers

  • bogukrbogukr UAMember ✭✭

    Does anyone know solution of this problem?

  • omarantonio16omarantonio16 Member ✭✭

    No tenemos acceso a la carpeta donde se encuentra instalada la aplicación. A mi me esta pasando lo mismo al tratar de mostrar un archivo pdf, no me deja acceder a archivos de instalación de la aplicación, en cambio, lo guardo todo en otra carpeta.

Sign In or Register to comment.