ok l'upload sembra andare solo che non riesco a scrivere nel database,
come posso scrivere il percorso completo di ogni file uplodato nel relativo campo??
ho fatto cosi
codice:
<form action="Save.asp" method="post" enctype="multipart/form-data" name="form1">
<table width="200" border="0">
<tr>
<td nowrap><div align="right">CLIENTE:</div></td>
<td nowrap><input name="cliente" type="text" id="cliente" size="35"></td>
</tr>
<tr>
<td nowrap><div align="right">DATA:</div></td>
<td nowrap><input name="data" type="text" id="data" value="18/07/2005" size="14" maxlength="10">
18/07/2005</td>
</tr>
<tr>
<td nowrap><div align="right">TIPOLOGIA:</div></td>
<td nowrap><input name="tipologia" type="text" id="tipologia" size="35"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO</div></td>
<td nowrap><INPUT TYPE="file" NAME="foto1"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO 1: </div></td>
<td nowrap><INPUT TYPE="file" NAME="foto2"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO 2:</div></td>
<td nowrap><INPUT TYPE="file" NAME="foto3"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO 3: </div></td>
<td nowrap><INPUT TYPE="file" NAME="foto4"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO 4:</div></td>
<td nowrap><INPUT TYPE="file" NAME="foto5"></td>
</tr>
<tr>
<td nowrap><div align="right">FOTO 5:</div></td>
<td nowrap><INPUT TYPE="file" NAME="foto6"></td>
</tr>
<tr>
<td height="24" nowrap><div align="right"></div></td>
<td nowrap><input type="submit" name="Submit" value="Invia"></td>
</tr>
</table>
</form>
codice:
<%
Dim oUpload,SaveOK
Set oUpload = new cUpload
SaveOK = True
oUpload.OverWrite=True
oUpload.AutoRename=False
oUpload.SetPath "Files\"
oUpload.Load
Do While Not oUpload.EOF
oUpload.Save()
If oUpload.Files("ErrorNumber")<>0 then
SaveOK=False
Exit Do
End if
oUpload.MoveNext
Loop
If Not SaveOK then
oUpload.Movefirst
Do While oUpload.EOF
If oUpload.Files("Saved") then
oUpload.Fso.DeleteFile oUpload.GetCompletePathFile(),true
End if
oUpload.MoveNext
Loop
Else
Response.Write "I files sono stati salvati."
.SetDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("/public/cartella/database/db.mdb"),"SELECT Top 1 * FROM tabella"
.Database.Open()
While Not .EOF
.Save
response.Write "il file " & .GetFileName &" è stato salvato
"
'Inserimento dei valori
.Database.Fields("cliente") = .Form("cliente")
.Database.Fields("data") = .Form("data") ' come posso far inserire la data automaticamente nel formato 18/07/2005
.Database.Fields("tipologia") = .Form("tipologia")
.Database.Fields("foto") = .GetCompletePathFile
.Database.Fields("foto1") = .GetCompletePathFile
.Database.Fields("foto2") = .GetCompletePathFile
.Database.Fields("foto3") = .GetCompletePathFile
.Database.Fields("foto4") = .GetCompletePathFile
.Database.Fields("foto5") = .GetCompletePathFile
'Inserimento
.Database.AddNew()
.MoveNext
Wend
End if
Set oUpload=Nothing
%>
ricevo questo errore
codice:
I files sono stati salvati.
Microsoft VBScript runtime error '800a01f9'
Invalid or unqualified reference
/public/cartella/Save.asp, line 29