且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在我的本地文件夹中下载Excel文件(D)?

更新时间:2023-09-30 15:15:52

您无法将文件保存到客户端计算机,只能发送文件,用户可以选择打开文件或将其保存到自己选择的位置。您在TransmitFile中提供的参数是要在服务器上发送的Excel文件的位置。 Google为asp.net向客户端传输文件以获取正确的示例。
You can't save a file to the client machine, you can only send the file and the user gets the option to open the file or save it to a place of their choice. The parameter you supply in TransmitFile is the location of the Excel file to send on the server. Google for "asp.net transmitting files to the client" for proper examples.


请参阅 https://msdn.microsoft.com/en-us/library/12s31dhy(v = vs.110).aspx [ ^ ]。文件名必须是服务器上源文件的路径。下载开始时,用户将选择本地计算机上的目标。
See https://msdn.microsoft.com/en-us/library/12s31dhy(v=vs.110).aspx[^]. The filename must be the path to the source file on the server. The destination on the local machine will be chosen by the user when the download starts.