hey guys... new to this forum....
i have read a few posts... but (as you can guess) with no success....
well, as title says.. i have some problems with image uploading...
i'm using MS SQL Server 2003
coding in Visual Basic
and running asp pages to control a the dll....
so well the save function in the dll is:
VB Code:
Public Function SaveRecord() As Long ConnectToDb Dim strSQL As String Dim rs As ADODB.Recordset strSQL = "Select * from tblDb" Set rs = New ADODB.Recordset rs.Open strSQL, cnn, adOpenKeyset, adLockOptimistic rs.AddNew rs!imgFile = imgFile rs!imgName = imgName rs.Update SaveRecord = rs!RecordId rs.Close End Function
Then as you can guess htere is a posting page (insert.html)
Code:<form id="Inserimento" method="post" action="save.asp" ENCTYPE="multipart/form-data"> <tr><td><input type="file" name="imgFile" size="25"></td> <td><input tabindex=0 type=text name="imgName" size=30></td> <!--...continues with more boxes.. -->
and the save.asp page which calls the dll....
Code:<%@ language=VBScript %> <%Option Explicit %> <html> <head> <title>Inserimento Eventi</title> <link rel="stylesheet" type="text/css" href="../style.css"> </head> <body> <% Dim imgFile Dim imgName imgFile = Request.Form("imgFile") imgName = Request.Form("imgName") Dim x set x = Server.CreateObject("project.class") x.GetimgFile(imgFile) x.GetimgName(imgName) x.SaveRecord set x = nothing 'response.redirect("insert.html") %> </body> </html>
----------------
displaying:
VB Code:
Public Sub SearchRecordId() Dim x As Long ConnectToDb Dim strSQL As String Dim rs As ADODB.Recordset strSQL = "Select * from tblDb where RecordId=" & lngRecordId Set rs = New ADODB.Recordset rs.Open strSQL, cnn, adOpenKeyset If rs.RecordCount = 0 Then Exit Sub '----------------------------- imgFile = rs!imgFile imgName = rs!imgName '----------------------------- rs.Close End Sub
VB Code:
Public Function ReturnViewImage() As String ReturnViewImage = imgFile End Function
asp page:
the last asp page requests the id from another page (and it works great...)Code:<% Dim strSearch Dim lngRecordID lngRecordID = Request.QueryString("ID") Dim x set x = Server.CreateObject("Project.Class") x.GetRecordID(lngRecordID) x.SearchRecordID response.binarywrite(x.ReturnViewImage) set x = nothing %>
but the image is not returned... any ideas?
should i post ALL the code?
thx
ac3bf1


Reply With Quote
--Kishore...