在用户方面下载文件
我正在寻找一种将文件保存到用户文件的方法 目录
我将HTML转换为PDF,然后将PDF保存到临时文件,
string fileName = System.IO.Path.GetTempPath() + id.ToString() + ".pdf";
await page.PdfAsync(fileName)
在这里我尝试下载文件(.pdf)在用户网站上,
var client = new WebClient();
client.DownloadFile(fileName, $"{id}.pdf");
但我认为它保存到服务器 未显示应用程序时用户方面的任何内容都没有显示
I'm looking for a way to save the file to the user's files
directory
I convert html to pdf, and save pdf to temporary file
string fileName = System.IO.Path.GetTempPath() + id.ToString() + ".pdf";
await page.PdfAsync(fileName)
Here I try download file (.pdf) on the user's site
var client = new WebClient();
client.DownloadFile(fileName, quot;{id}.pdf");
but I think it save to the server
nothing on the user's side when the app is published is not displayed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您可以从此处使用
https:> https:> https: //www.codeproject.com/articles/878605/getting-all-pecial-folders-in-net
,然后在客户端做出这样的事情
I guess you can use the class KnownFolders from here
https://www.codeproject.com/Articles/878605/Getting-All-Special-Folders-in-NET
and then on the client side make something like that
如果您要允许使用该应用程序下载文件的人:
您可以使用 https:// github 。
if you want allow the person who will use the application to download the file:
u can use https://github.com/hardkoded/puppeteer-sharp to convert html to .pdf in Stream format
ServiceController
and use return File() in method
ExportController