the html would look something like:
<FORM METHOD="POST" ACTION="Sample4.asp"
ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
But you need a component to call in Sample4.asp to process the
upload. Here's the Sample4.asp code:
<HTML>
<BODY BGCOLOR="white">
<H1>aspSmartUpload : Sample 4</H1>
<HR>
<%
' Variables
' *********
Dim mySmartUpload
Dim file
Dim oConn
Dim oRs
Dim intCount
intCount=1
' Object creation
' ***************
Set mySmartUpload =
Server.CreateObject("aspSmartUpload.SmartUpload")
' Upload
' ******
mySmartUpload.Upload
' Connect to the DB
' *****************
Set oConn = openConnection( )
'curDir = Server.MapPath("Sample.mdb")
'oConn.Open "DBQ="& curDir &";Driver={Microsoft Access
Driver (*.mdb)};DriverId=25;FIL=MS Access;"
' Open a recordset
' ****************
strSQL = "SELECT RecordID, FileName, Type, [File] FROM
tblFiles "
Set oRs = Server.CreateObject("ADODB.recordset")
'Set oRs.ActiveConnection = oConn
'oRs.Source = strSQL
oRs.LockType = 3
Call oRs.Open( strSQL, oConn, adOpenDynamic,
adLockPessimistic )
' Select each file
' ****************
For each file In mySmartUpload.Files
' Only if the file exist
' **********************
If not file.IsMissing Then
' Add the current file in a DB field
' **********************************
oRs.AddNew
file.FileToField oRs.Fields("File")
oRs("FileName") = file.FileName
oRS( "Type" ) = "tst"
oRS( "RecordID" ) = intCount
oRs.Update
intCount = intCount + 1
End If
Next
' Display the number of files uploaded
' ************************************
Response.Write(intCount & " file(s) uploaded.<BR>")
' Destruction
' ***********
oRs.Close
oConn.Close
Set oRs = Nothing
Set oConn = Nothing
%>
</BODY>
</HTML>
<%
function openConnection()
Dim objConnection
set objConnection =
Server.CreateObject("ADODB.Connection")
objConnection.Provider = "SQLOLEDB"
objConnection.Open "Source=dev1;UID=sa;PWD=;Initial
Catalog=bcc1-military;"
' objConnection.Open Application("ConnectionString")
set openConnection = objConnection
end function
%>
The above is a quickie but you should really use sp's to talk to the
db.
I recommend the SmartASP component only because it is free !
http://www.aspsmart.com