using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(HttpMethod.Get,new Uri("http://preprod.quickappsbuilder.com/api/apps/getapp2")))
{
using (Stream contentStream = await (await httpClient.SendAsync(request)).Content.ReadAsStreamAsync(),
stream = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.None, 2048, true))
{
IFile file = await FileSystem.Current.GetFileFromPathAsync(fs.filepath);
byte[] buffer = new byte[100];
using (System.IO.Stream stream1 = await file.OpenAsync(FileAccess.ReadAndWrite))
{
stream1.Write(buffer, 0, 100);
}
await contentStream.CopyToAsync(stream);
}
}
}
↧
FileStream does not exist add reference in xamarin form // FileSystem.Current.GetFileFromPathAsync
↧