Ti posto il codice delle pagine:
form.asp
codice:
<%
If Request.QueryString("Save")="1" then
Dim oUpload
Set oUpload = new cUpload
oUpload.AutoRename = True
oUpload.Overwrite = False
oUpload.SetPath "public/immagini" 'Impostazione del PERCORSO della cartella delle IMMAGINI
oUpload.Load
While Not oUpload.EOF
oUpload.Save()
Select Case lCase(oUpload.Files("InputName"))
Case "immg1"
FileName_immg1 = oUpload.GetFileName()
Case "immg2"
FileName_immg2 = oUpload.GetFileName()
Case "immg3"
FileName_Immg3 = oUpload.GetFileName()
Case "immg4"
FileName_Immg4 = oUpload.GetFileName()
Case "immg5"
FileName_Immg5 = oUpload.GetFileName()
Case "immg6"
FileName_Immg6 = oUpload.GetFileName()
End Select
oUpload.MoveNext
Wend
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("database.mdb")
Set Rs=server.CreateObject("ADODB.Recordset")
Rs.Open "tabella",Conn,3,3
Rs.AddNew
Rs("titolo") = oUpload.Form("titolo")
Rs("descrizione") = oUpload.Form("descrizione")
Rs("immg1") = FileName_immg1
Rs("immg2") = FileName_immg2
Rs("immg3") = FileName_Immg3
Rs("immg4") = FileName_Immg4
Rs("immg5") = FileName_Immg5
Rs("immg6") = FileName_Immg6
Rs.update
Rs.Close
Conn.Close
Set Rs = Nothing
Set Conn=Nothing
Set oUpload = Nothing
End if
%>
<form name="form1" method="post" enctype="multipart/form-data" action="?save=1">
<blockquote>
<div align="center">
<table border="0" width="90%" id="table1">
<tr>
<td width="38%">
<p align="right"><font face="Verdana" size="2" color="#000080">
Titolo</font><font color="#000080" face="Verdana">
<input name="titolo" type="text" id="titolo" size="30"></font></td>
<td width="4%"></td>
<td width="57%"><font size="2" color="#000080" face="Verdana">
immagine1 </font>
<font color="#000080" face="Verdana">
<input name="immg1" type="file" id="immg1" ></font></td>
</tr>
<tr>
<td width="38%">
<p align="right">
<font size="2" color="#000080" face="Verdana"></font><font size="2" color="#000080" face="Verdana"> </font>
</td>
<td width="4%"></td>
<td width="57%"><font size="2" color="#000080" face="Verdana">
immagine2 </font>
<input name="immg2" type="file" id="immg2" >
<font color="#000080" face="Verdana">
<font size="2">immagine3 </font>
<input name="immg3" type="file" id="immg3" size="20" >
<font size="2">immagine4 </font>
<input name="immg4" type="file" id="immg4" size="20" >
<font size="2">immagine5 </font>
<input name="immg5" type="file" id="immg5" size="20" >
<font size="2">immagine6 </font>
<input name="immg6" type="file" id="immg6" size="20" ></font></td>
</tr>
<tr>
<td colspan="3">
<p align="center"><font size="2" color="#000080" face="Verdana">
Testo</font>
<textarea rows="11" name="descrizione" cols="106"></textarea></td>
</tr>
<tr>
<td width="38%"></td>
<td width="4%">
<p align="center">
<input type="submit" name="Submit" value="Invia"></td>
<td width="57%"></td>
</tr>
</table>
</blockquote>
</form>
Il file upload.asp (ce l'hai già, visto che lo hai messo nel file zippato; è quello da 36kb)
Il database è così composto:
Nome del database: database nome della tabella: tabella
nome campo...............tipo dati
id.........................contatore
titolo........................testo
descrizione.................memo
immg1.......................testo
immg2.......................testo
immg3.......................testo
immg4.......................testo
immg5.......................testo
immg6.......................testo
Con questa pagina puoi uploadare 1 titolo, una descrizione e 6 immagini, ma puoi aumentare il numero delle immagini da uploadare
Fai sapere.