本文介绍了.msg附件不能自动打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我打开.msg附件时,它不会在Outlook中自动打开。下载文件提示将扩展名显示为.asp。如果我保存文件,更改扩展名并打开,它可以正常工作。这对于其他mime类型(doc,xls,pdf等)是否正常工作。

我在加载数据之前在DB中设置内容类型

如果instr(fileName,"。 xls")> 0然后
contentType ="application / vnd.ms-excel"
elseif instr(fileName,"。doc")> 0然后
contentType ="application / msword"
elseif instr(fileName,"。pt")> 0然后
contentType ="application / ms-powerpoint"
elseif instr(fileName,"。msg")> 0然后
contentType ="application / vnd.ms-outlook"
结束如果

用于DB中的文件数据加载我使用

rs("FileData")。AppendChunk fileData


在下载文件时

rs.Open"从IPC_Files中选择FileData,ContentType,其中ID ="& ID,oConn.strng,2,4
如果不是rs.EOF那么
Response.ContentType = rs("ContentType")
Response.BinaryWrite rs("FileData")
rs .Close
Response.End
结束如果

Hi,

When i open a .msg attachement it doesn't auto open in outlook. The download file prompt shows the extension as .asp. If I save the file, change the extension and open, it works. How ever this is working fine for other mime types(doc, xls, pdf etc).

I am setting the content type in DB before I load data

if instr(fileName, ".xls") > 0 then
contentType = "application/vnd.ms-excel"
elseif instr(fileName, ".doc") > 0 then
contentType = "application/msword"
elseif instr(fileName, ".ppt") > 0 then
contentType = "application/ms-powerpoint"
elseif instr(fileName, ".msg") > 0 Then
contentType = "application/vnd.ms-outlook"
end If

for file data load in DB i use

rs("FileData").AppendChunk fileData


And while downloading the file

rs.Open "select FileData,ContentType from IPC_Files where ID = " & ID, oConn.strng, 2, 4

If Not rs.EOF Then
Response.ContentType = rs("ContentType")
Response.BinaryWrite rs("FileData")
rs.Close
Response.End
End If

推荐答案


这篇关于.msg附件不能自动打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 06:20