上传和下载文件 [英] upload and download document

查看:102
本文介绍了上传和下载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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......

推荐答案

下载:

无需编程,如果您在HTML代码中有一个锚点,其中href指向文档的URI,则只需使用内容菜单项另存为"即可:
Downloading:

Without programming, if you have an anchor in HTML code with href pointing to document''s URI, you can simply use content menu item "Save As":
<a href="myDocument.pdf">Download document</a>



如果用户单击该链接,则可能会根据文件类型将其作为页面加载.
这是您可以使用Content-disposition:
通过另存为"对话框强制执行下载的方法: http://support.microsoft.com/kb/260519 [ 这是详细的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[^].

—SA


这篇关于上传和下载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆