很急的问题,求助各位!关于从数据库字段里读出文件的下载处理。
rs("file")是从sybase数据库的image字段里读出来的文件,我运用以下代码将文件保存到用户客户端
'根据附件类型判断ContentType
dim ContentType
Select Case ext
Case "doc" ContentType="application/msword"
Case "ppt" ContentType="application/vnd.ms-powerpoint"
Case "xls" ContentType="application/x-msaccess"
Case "pdf" ContentType="application/pdf"
Case "html" ContentType="text/html"
Case "htm" ContentType="text/html"
Case "xml" ContentType="text/xml"
Case "xsl" ContentType="text/xml"
Case "zip" ContentType="application/x-zip-compressed"
Case "jpg" ContentType="image/jpeg"
Case "jpge" ContentType="image/jpeg"
Case "bmp" ContentType="image/bmp"
Case "gif" ContentType="image/gif"
Case Else ContentType="application/octet-stream"
End Select
'产生附件
Response.ContentType=ContentType
Response.BinaryWrite rs("file").getChunk(rs("file").ActualSize)
但是用户将附件下载到本地后大于1.00mb的文件都只有1.00mb(查看数据库发现他们都是大于1.00mb的),不知道那里出错了。谢谢支持!