问题描述
如何在asp.net中上载文档和下载文档.....
我需要知道c#中的编码...
谢谢......
how to upload a document and download a document in asp.net........
i need to know the coding in c#......
Thank you......
推荐答案
<a href="myDocument.pdf">Download document</a>
如果用户单击该链接,则可能会根据文件类型将其作为页面加载.
这是您可以使用Content-disposition
:
通过另存为"对话框强制执行下载的方法: http://support.microsoft.com/kb/260519 [ ^ ].
上传:
要上传文件,您只需要一个带有方法"POST"的Web表单,但是要处理上传,您需要一些服务器端编码.
这是详细的ASP.NET教程: http://www.asp.net/data-access /tutorials/uploading-files-cs [ ^ ].
此CodeProject文章提供了非常清晰和简单的说明:使用ASP.NET上传文件 [ ^ ].
If the use clicks the link, it might be just loaded as a page, depending of file type.
This is how you can enforce downloading with "Save As" dialog using Content-disposition
:
http://support.microsoft.com/kb/260519[^].
Uploading:
To upload a file, you just need a Web form with method "POST", but to process the upload you need some server-side coding.
This is the detailed ASP.NET tutorial: http://www.asp.net/data-access/tutorials/uploading-files-cs[^].
This CodeProject article provides very clear and simple explanation: File Upload with ASP.NET[^].
这篇关于上传和下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!