【发布时间】:2017-11-21 10:18:24
【问题描述】:
我想知道是否可以使用 xamarin.forms 将任何类型的文件下载到设备。de 文件存储在 Azure 上,我得到了文件的 Memorystream,它对我的应用程序非常重要。我的问题实际上分为两部分, 如何将de文件下载到用户的设备上? 以及如何在该类型的默认应用程序(如pdf阅读器)中显示任何类型的文件
这是我尝试过的
MemoryStream memoryStream = AzureDownloader.DownloadFromAzureBlobStorage(null, doc.azure_container, doc.file_path, ref filen, true);
string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
string localFilename = doc.filename;
string localPath = Path.Combine(documentsPath, localFilename);
File.WriteAllBytes(localPath, memoryStream.ToArray()); // this is a try to save to local storage
任何帮助表示赞赏
【问题讨论】:
标签: file azure xamarin xamarin.forms memorystream