<% '-------------------------------------------- Response.Buffer = True Dim strFilePath, strFileSize, strFileNameConst adTypeBinary = 1 strFilePath = "文件路径 " strFileSize = ... 文件大小,可选 strFileName = "文件名" Response.Clear '8*******************************************8 ' 需要在你的服务器上安装 MDAC 2.6 或MDAC2.7 '8*******************************************8 Set objStream = Server.CreateObject("ADODB.Stream") objStream.Open objStream.Type = adTypeBinary objStream.LoadFromFile strFilePath strFileType = lcase(Right(strFileName, 4)) '文件扩展名 ' 通过文件扩展名判断 Content-Types Select Case strFileType Case ".asf" ContentType = "video/x-ms-asf" Case ".avi" ContentType = "video/avi" Case ".doc" ContentType = "application/msword" Case ".zip" ContentType = "application/zip" Case ".xls" ContentType = "application/vnd.ms-excel" Case ".gif" ContentType = "image/gif" |