Lecture d'un champ blob avec mysql et ASP
Salut a tous
J'essai de lire un champ blob mysql (principalement une image) via un script asp, j'ai prit un code qui fonctionnais tres bien avec access , et transposer pour mysql (seulement la connection finalement), mais l'image en question ne s'affiche pas, j'ai toujours un beau X :cry: voici mon code, j'espere avoir la solution bientot :D
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<%
Dim Sql
' Grab file ID from query string
Sql = "SELECT * from test1234 where id = 1"
set Rb = Server.CreateObject("ADODB.Recordset")
rb.CursorLocation = adUseClient
Rb.Open sql, Conn, adOpenDynamic, adLockOptimistic
' If we have at least one record
If Not rb.EOF Then
' Write out the headers identifying the file
Response.AddHeader "content-disposition", "filename=Clown.gif"
'Response.AddHeader "content-disposition", "attachment; filename=" & RecordSet("FileName")
Response.AddHeader "content-length", rb("image").ActualSize
Response.ContentType = rb("ContentType")
' Write the file
Response.BinaryWrite rb("image")
Else
' Notify the visitor of the problem
Response.Write("File could not be found")
End If
%>
|
merci de votre aide