字體:小 中 大 |
|
|
|
| 2013/10/09 09:26:27瀏覽148|回應0|推薦1 | |
<% br="">sn = cint(Now_GET("sn")) name_file = session("doc_dl_file") if sn=0 or name_file="" then CALL Tjs_Alert("表單接收錯誤...","history.go(-1);") response.end() end if pos=InstrRev(name_file,".") SubName=mid(name_file,pos) Select Case LCase(SubName) Case ".pdf" Response.ContentType = "application/pdf" Case ".asf" Response.ContentType = "video/x-ms-asf" Case ".avi" Response.ContentType = "video/avi" Case ".doc" Response.ContentType = "application/msword" Case ".zip" Response.ContentType = "application/zip" Case ".xls" Response.ContentType = "application/vnd.ms-excel" Case ".gif" Response.ContentType = "image/gif" Case ".jpg", "jpeg" Response.ContentType = "image/jpeg" Case ".wav" Response.ContentType = "audio/wav" Case ".mp3" Response.ContentType = "audio/mpeg3" Case ".mpg", "mpeg" Response.ContentType = "video/mpeg" Case ".rtf" Response.ContentType = "application/rtf" Case ".htm", "html" Response.ContentType = "text/html" Case Else Response.ContentType = "application/octet-stream" End Select response.addheader "Content-Disposition","attachment; filename=" & chr(34) & name_file & chr(34) response.binarywrite getBinaryFile(server.mappath(getpic_ph&name_file)) function getBinaryFile(fileSpec) Dim adTypeBinary adTypeBinary = 1 Dim oStream set oStream = server.createobject("ADODB.Stream") oStream.Open oStream.Type = adTypeBinary oStream.LoadFromFile fileSpec getBinaryFile= oStream.read set oStream=nothing end function %> |
|
| ( 興趣嗜好|電腦3C ) |









