如何从href标签直接下载.dxf和.stp文件 [英] how to direct download .dxf and .stp file from href tag

查看:114
本文介绍了如何从href标签直接下载.dxf和.stp文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从href标签直接下载.dxf和.stp文件



如果我写为

打开标签a href =/ Asset / 3000-000-3instrk.dxf> 3000-000-3instrk.dxf



然后它给出错误





应用程序中的服务器错误。



无法找到资源。



描述:HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,其名称已更改,或者暂时不可用。请查看以下网址,确保拼写正确。



请求的URL:/index.aspx

how to direct download .dxf and .stp file from href tag

if I write as
"open tag a href="/Asset/3000-000-3instrk.dxf">3000-000-3instrk.dxf "

then it give error


Server Error in Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /index.aspx

推荐答案

默认情况下,IIS不会提供静态文件一个无法识别的扩展名。您需要为要下载的扩展名添加MIME类型。



添加静态内容MIME映射< mimeMap> :官方Microsoft IIS站点 [ ^ ]

By default, IIS will not serve static files with an unrecognised extension. You need to add a MIME type for the extensions you want to download.

Adding Static Content MIME Mappings <mimeMap> : The Official Microsoft IIS Site[^]
<configuration>
  <system.webServer>
    <staticContent>
      <mimeMap fileExtension=".dxf" mimeType="application/dxf" />
      <mimeMap fileExtension=".stp" mimeType="application/STEP" />
    </staticContent>
  </system.webServer>
</configuration>


这篇关于如何从href标签直接下载.dxf和.stp文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆