我尝试使用api从Dropbox下载文件,当我们提供静态路径时会下载文件,在该文件夹中仅保存但不显示任何弹出式保存或打开文件。
请查看我的代码:
异步任务下载(DropboxClient dbx,字符串文件夹,字符串文件) {
string remoteFilePath = folder+"/" + file;
string localFilePath = "C:/Users/DRPBX/Desktop/download";
using (var response = await dbx.Files.DownloadAsync(remoteFilePath))
{
using (var fileStream = File.Create(localFilePath + "/" + file))
{
response.GetContentAsStreamAsync().Result.CopyTo(fileStream);
}
}
}
如果我们在该文件夹中提供静态本地路径,则直接保存而无需任何弹出式保存或打开文件。
我的需求是需要下载而不提供本地路径,并且需要弹出窗口进行下载。
请帮助我。
非常感谢。