Laith jodeh
05-19-2010, 08:27 AM
hi all , I have found the following simple example to upload file to ms access
database using plain asp. and the problem is that I want to upload without browsing the same image name ( mymap.jpg ) which always allocated in the following directory:
(D:\MyPics\Testlevel) automatically everytime without using file input in the form rather I want just to use text input in form as follows:
<form method="POST" name="show" enctype="multipart/form-data" action="Insert.asp">
<td>File :</td><td>
<input type="text" name="mypic" value="D:\\MyPics\\mymap.jpg .jpg" size="40"></td></tr>
<td> </td><td>
<input type="submit" value="Submit"></td></tr>
</form>
and my adding code just gotten from this url:
http://techrepublic.com.com/5208-1035-0.html;jsessionid=8B1213C27486FA5BEEE926163A5C795F?forumID=102&threadID=244685&messageID=3288371&tag=content;leftCol
as follows:
<%
If fileSize > 0 Then
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open server.mappath("./db1.mdb")
' Recordset object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Files", conn, 2, 2
' Adding data
rs.AddNew
rs("File Data").AppendChunk mypic ' here i want to add reference to my file
rs("name") = nameInput
rs("age") = ageInput
rs("address") = address
rs.Update
rs.Close
Set rs = Nothing
%>
database using plain asp. and the problem is that I want to upload without browsing the same image name ( mymap.jpg ) which always allocated in the following directory:
(D:\MyPics\Testlevel) automatically everytime without using file input in the form rather I want just to use text input in form as follows:
<form method="POST" name="show" enctype="multipart/form-data" action="Insert.asp">
<td>File :</td><td>
<input type="text" name="mypic" value="D:\\MyPics\\mymap.jpg .jpg" size="40"></td></tr>
<td> </td><td>
<input type="submit" value="Submit"></td></tr>
</form>
and my adding code just gotten from this url:
http://techrepublic.com.com/5208-1035-0.html;jsessionid=8B1213C27486FA5BEEE926163A5C795F?forumID=102&threadID=244685&messageID=3288371&tag=content;leftCol
as follows:
<%
If fileSize > 0 Then
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open server.mappath("./db1.mdb")
' Recordset object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Files", conn, 2, 2
' Adding data
rs.AddNew
rs("File Data").AppendChunk mypic ' here i want to add reference to my file
rs("name") = nameInput
rs("age") = ageInput
rs("address") = address
rs.Update
rs.Close
Set rs = Nothing
%>