上传文件 [英] upload file file
本文介绍了上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用vb.net下载和上传文件代码?
download and upload file code using vb.net?
推荐答案
这很酷:
Silverlight 4拖放文件管理器 [搜索 [
This is cool:
Silverlight 4 Drag and Drop File Manager[^]
BTW: Searching[^] is always a good idea ...
Regards
Espen Harlinn
文件上传
Hi,
File Upload
If FileUpload1.PostedFile.ContentLength > 0 Then
Dim file As String = Server.MapPath("UploadedFiles/" & PostedFile.FileName);
FileUpload1.SaveAs(file);
End If
文件下载
File Download
Public Shared Sub DownloadFile(FileName As String)
If File.Exists(FileName) Then
Dim strFileName As String = Path.GetFileName(FileName).Replace(" ", "%20")
HttpContext.Current.Response.ContentType = "application/octet-stream"
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" & strFileName)
HttpContext.Current.Response.Clear()
HttpContext.Current.Response.WriteFile(FileName)
HttpContext.Current.Response.[End]()
End If
End Sub
谢谢,
Imadhusen
Thanks,
Imadhusen
让我为您找到Google! [^ ]
这篇关于上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文