PCL Storage issue

MiguelCervantesMiguelCervantes ✭✭✭MXMember ✭✭✭

Hi there!

I'm having an issue with the PCL Storage, i'm tring to write different files but so far just one file is created, the second file fails, is this caused by Android/iOS that I can't write more than one file in the app root location?

Answers

  • MiguelCervantesMiguelCervantes ✭✭✭ MXMember ✭✭✭

    Never mind! Got it working! PCL Storage rocks!

  • EduardoEncinaEduardoEncina USMember

    how? im having that trouble... can you share your solution please?

  • MiguelCervantesMiguelCervantes ✭✭✭ MXMember ✭✭✭

    @EduardoEncina sure,

        public async Task SaveFile(string fileName, string contents)
        {
            var Folder = await FileSystem.Current.LocalStorage.CreateFolderAsync("myFolder", CreationCollisionOption.OpenIfExists);
            IFile file = await Folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
            await file.WriteAllTextAsync(contents);
        }
    
  • EduardoEncinaEduardoEncina USMember

    Thanks bro!

Sign In or Register to comment.