zoukankan      html  css  js  c++  java
  • 下载文件 application/octetstream (VB.NET)

            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)

  • 相关阅读:
    关于视图的说明和设计
    关于REST风格API的设计
    关于 Linux 操作
    文件删除
    文件写入有读取
    生成器,迭代器
    Linux防火墙相关命令
    Linux下安装Maven
    Linux下安装Nginx
    Word相关知识点
  • 原文地址:https://www.cnblogs.com/RobotTech/p/533653.html
Copyright © 2011-2022 走看看