Dim SMS_UploadFiles_Path As String = System.Configuration.ConfigurationSettings.AppSettings("SMS_UploadFiles_Path")
        'Dim mPath As String = Server.MapPath(SMS_UploadFiles_Path) + "\"
        Dim mPath As String = ""
        If SMS_UploadFiles_Path.EndsWith("\") = False Then
            mPath = SMS_UploadFiles_Path + "\"
        Else
            mPath = SMS_UploadFiles_Path
        End If
 
        Dim str_att As String = Request.QueryString("att")
        Dim str_oatt As String = Request.QueryString("oatt")

        Dim extandName As String = Path.GetExtension(str_oatt)
        Dim fileName As String = Path.GetFileNameWithoutExtension(str_oatt)

        If (fileName.Length > 12) Then
            fileName = fileName.Substring(0, 12)
        End If

Response.Clear()
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=" & HttpUtility.UrlEncode(fileName) & extandName)
Response.WriteFile(mPath + str_att)

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2021-08-11
  • 2022-12-23
  • 2021-06-20
  • 2021-12-15
  • 2022-12-23
  • 2021-08-06
猜你喜欢
  • 2021-09-19
  • 2022-12-23
  • 2021-03-30
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案