Aspupload kan ikke hente billede.
Hvorfor kan jeg ikke hente billede fra databasen.Uploader fint, "Path" og "lange binære data" er i basen.
Men jeg tror at den uploader forkert.
uploader med dette script:
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.SetMaxSize 50000, True
Upload.SaveVirtual("/log/")
fileID = upload.form("id")
For Each File in Upload.Files
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " &_
"DBQ=" & Server.Mappath("/log/db.mdb") & ";"
File.ToDatabase strDSN, "update hold set Path = '"&File.Path&"', data = '?' where id = " & fileID
if Err <> 0 Then
Response.Write "Error saving the file: " & Err.Description
Else
File.Delete
Response.Write "File "&FileID&", uploaded!<br>"
End If
Next
%>
Henter billede med dette script:
<%
Set DB = Server.CreateObject("ADODB.Connection")
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)}; " &_
"DBQ=" & Server.Mappath("/log/db.mdb") & ";"
DB.Open strDSN
Set RS = DB.Execute("SELECT Data FROM hold where ID = " & Request("ID") )
Response.ContentType = "image/jpeg" '(or "image/gif")
Response.BinaryWrite RS("Data")
RS.Close
DB.Close
%>