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)

  • 相关阅读:
    Minecraft我的世界如何联机
    关于我的博客地址jvav的由来
    ThreadLocal使用
    使用免费tk域名
    MVC的request,response流程
    TiDB原理与集群架构
    net5 自定义 中间件
    net5 Autofac支持
    net5 Autofac 支持AOP (1)
    mysql 索引优化
  • 原文地址:https://www.cnblogs.com/RobotTech/p/533653.html
Copyright © 2011-2022 走看看