我有一个.aspx页面让用户下载.exe文件。代码是
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim FilePart As String = Request.QueryString("file")
Dim folder_path As String = Server.MapPath("folder1/subfolder1/")
If Not String.IsNullOrEmpty(FilePart) Then
Dim FileName As String = IO.Path.Combine(folder_path, FilePart)
If IO.File.Exists(FileName) Then
Response.ContentType = "application/x-msdownload"
Response.AddHeader("Content-disposition", "attachment; filename=" _
& FilePart)
Response.WriteFile(FileName)
End If
Else
Response.Write("<html><body>Not Found</body></html>")
End If
End Sub
目标文件(.exe)的原始大小为11 MB。但是,当用户下载它时,大小增加到34 MB。有趣的是,该文件运行并且没有任何问题,但它让我觉得为什么大小会急剧增加。
有什么方法可以解决这个问题吗?
提前致谢