Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Download a byte array of a file to mobile

I have converted my file to byte array and saved in database and how can i save that file to my local device

Answers

  • shockratesshockrates Member ✭✭
    edited September 2019

    Can anyone please help out with this?
    I have seen related solutions here but most of them are referred on downloading the file from a url . There is no url for me. I get a byte[] from db (through a web service) and I want to download it on the device android / ios. I am using the MVVM pattern and I am trying to implement it from the ViewModel of my View.

  • PhilipOGormanPhilipOGorman USMember ✭✭✭

    File.WriteAllBytes(System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "Data", myfile.txt), byteArray);

Sign In or Register to comment.