Modificare il file:
\Nascite\getfile.asp
<% strConnection = "Provider=MSDataShape;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("/mdb-database/\list-noz.mdb") & ";UID=;PWD=" Dim oleHeaderSize, binImage Dim lngImageSize, binTemp Dim nSkip Response.Expires = 0 Response.Buffer = True Response.Clear ' connect to the database Set oConnection = Server.CreateObject("ADODB.Connection") oConnection.ConnectionString = strConnection oConnection.ConnectionTimeout = 7 oConnection.Open ' table and where clause needs to be dynamic sSQL = "SELECT " & AddWrappers(Request("picfield")) strFileName = Request("filename") if strFileName="" then strFileName = "'file.bin'" else strFileName = AddWrappers(strFileName) end if sSQL = sSQL & ", " & strFileName & " FROM " & AddWrappers(Request("pictable")) & " " & "WHERE " & Request("where") Set rsPic = oConnection.Execute(sSQL) binTemp = rsPic(0).GetChunk(rsPic(0).ActualSize) strFileName = rsPic(1) if IsNull(binTemp) then response.end end if strFileType = lcase(Right(strFileName, 4)) ' Feel Free to Add Your Own Content-Types Here 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" Case ".jpg", "jpeg" ContentType = "image/jpeg" Case ".wav" ContentType = "audio/wav" Case ".mp3" ContentType = "audio/mpeg3" Case ".mpg", "mpeg" ContentType = "video/mpeg" Case ".rtf" ContentType = "application/rtf" Case ".htm", "html" ContentType = "text/html" Case ".asp" ContentType = "text/asp" Case ".pdf" ContentType = "application/pdf" Case Else 'Handle All Other Files ContentType = "application/octet-stream" End Select Response.ContentType = ContentType Response.AddHeader "Content-Disposition", "attachment;Filename=" & strFileName Response.AddHeader "Content-Length", rsPic(0).ActualSize Response.BinaryWrite binTemp rsPic.Close Set rsPic = Nothing oConnection.Close Set oConnection = Nothing Response.End function AddWrappers(strName) if (InStr(1, strConnection, "Microsoft Access")>1 or isnumeric(strName) or InStr(strName, " ")>0 or InStr(strName, "'")>0 or InStr(strName, "_")>0 or InStr(strName, "-")>0 or InStr(strName, "#")>0 or InStr(strName, ")")>0 or InStr(strName, "(")>0 or InStr(strName, "/")>0) and Left(strName,1)<>strLeftWrapper then AddWrappers = strLeftWrapper + strName + strRightWrapper else AddWrappers = strName end if end function %>
[
Íàçàä
]