LeonLMedlem sedan dec. 20023 175 inlägg
Den här koden använder jag:
'objRS("content_type") = "image/gif"
Response.ContentType = objRS("content_type")
Response.BinaryWrite objRS("bild")
Resultatet blir:
GIF89a÷ÿÿÿ€€€€€€€€€€€€ÀÀÀÿÿÿÿÿÿÿÿÿÿÿÿ3f™Ìÿ3333f3™3Ì3ÿff3fff™fÌfÿ™™3™f™™™Ì™ÿÌÌ3ÌfÌ™ÌÌÌÿÿÿ3ÿfÿ™ÿÌÿÿ3333f3™3Ì3ÿ3333333f33™33Ì33ÿ3f3f33ff3f™3fÌ3fÿ3™3™33™f3™™3™Ì3™ÿ3Ì3Ì33Ìf3Ì™3ÌÌ3Ìÿ3ÿ3ÿ33ÿf3ÿ™3ÿÌ3ÿÿff3fff™fÌfÿf3f33f3ff3™f3Ìf3ÿffff3fffff™ffÌffÿf™f™3f™ff™™f™Ìf™ÿfÌfÌ3fÌffÌ™fÌÌfÌÿfÿfÿ3fÿffÿ™fÿÌfÿÿ™™3™f™™™Ì™ÿ™3™33™3f™3™™3Ì™3ÿ™f™f3™ff™f™™fÌ™fÿ™™™™3™™f™™™™™Ì™™ÿ™Ì™Ì3™Ìf™Ì™™ÌÌ™Ìÿ™ÿ™ÿ3™ÿf™ÿ™™ÿÌ™ÿÿÌÌ3ÌfÌ™ÌÌÌÿÌ3Ì33Ì3fÌ3™Ì3ÌÌ3ÿÌfÌf3ÌffÌf™ÌfÌÌfÿ̙̙3Ì™fÌ™™Ì™ÌÌ™ÿÌÌÌÌ3ÌÌfÌÌ™ÌÌÌÌÌÿÌÿÌÿ3ÌÿfÌÿ™ÌÿÌÌÿÿÿÿ3ÿfÿ™ÿÌÿÿÿ3ÿ33ÿ3fÿ3™ÿ3Ìÿ3ÿÿfÿf3ÿffÿf™ÿfÌÿfÿÿ™ÿ™3ÿ™fÿ™™ÿ™Ìÿ™ÿÿÌÿÌ3ÿÌfÿÌ™ÿÌÌÿÌÿÿÿÿÿ3ÿÿfÿÿ™ÿÿÌÿÿÿ!ù,@CH° Áƒ |À à #>tØ0¢Å‹@,¸1#‰AzÔh°ãÈ“+†4‰R¤F•']ºLÉ&Ê›8 ;
Vad har jag gjort för misstag?
voigtann1Medlem sedan juni 20018 810 inlägg
den skriver ju ut gif bilden som finns i databasen... direkt.. coolt :e har aldrig sett binarywrite innan.. provat
response.binarywrite "<img src='" & objRS("bild") & "'>"
?
LeonLMedlem sedan dec. 20023 175 inlägg
Så kan man inte göra! :e
Testar för skojs skull...
... ... ... några sekudner senare ... ... ...
Microsoft VBScript runtime error '800a000d'
Type mismatch
:e
voigtann1Medlem sedan juni 20018 810 inlägg
rolig sak iallafall :e ska bevaka denna tråd :e
LeonLMedlem sedan dec. 20023 175 inlägg
test.asp:
<html>
<head>
<title>test</title>
</head>
<body>
<h1>BILDER!</h1>
<img src="test2.asp?id=<%=Request.Querystring("id")%>">
</body>
</html>
test2.asp:
<%
SQL = "SELECT * FROM bilder WHERE adressid = " & Request.Querystring("id")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("adressbok.mdb")
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, Conn
Response.ContentType = RS("content_type")
Response.BinaryWrite RS("bild")
RS.Close
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%>
Det funkar! :e :e :e
Men den funkar bara på IIS... på Loopias server laddar den i evigheter :S :l
WEIRD!