Asp classic MS Access文件的可下载链接
我一直在为.mdf MS Access文件创建链接,通过该链接可以下载该文件。我经历过许多类似的问题和答案,但运气不好。我试图在简单的html文件中使用锚定标记,但没有成功 后来我尝试了经典的asp脚本,但也不起作用。下面给出了经典的ASP脚本Asp classic MS Access文件的可下载链接,asp-classic,Asp Classic,我一直在为.mdf MS Access文件创建链接,通过该链接可以下载该文件。我经历过许多类似的问题和答案,但运气不好。我试图在简单的html文件中使用锚定标记,但没有成功 后来我尝试了经典的asp脚本,但也不起作用。下面给出了经典的ASP脚本 <% const adTypeBinary = 1 'Set the content type to the specific type that you are sending. Response.ContentType =
<%
const adTypeBinary = 1
'Set the content type to the specific type that you are sending.
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=labels.mdf"
set objStream = Server.CreateObject("ADODB.Stream")
objStream.open
objStream.type = adTypeBinary
'objStream.LoadFromFile(strFilePath & strFile)
objStream.LoadFromFile(server.MapPath("labels.mdf"))
response.binarywrite objStream.Read
objStream.close
Set objStream = nothing
%>
注意:我们使用经典ASP作为服务器端语言,所以如果需要的话,你考虑一下。
我想是因为正在使用MDF文件。据我所知,*.mdf是sql server数据库文件。。因此,只要SQL server正在运行并为相关数据库提供服务,就不可能获得它。我的建议是:
分离相关数据库 确保您具有对相关文件夹的读取权限请编辑问题并描述发生的情况为什么不使用请求筛选模块允许IIS提供.mdf文件。是否下载服务器上的access文件?