ciao,
da una ricerca sul forum ho trovato alcune modifiche
da fare al codice per rendere upload del file facoltativo,
però mi da questo errore:
(Tipo di errore:
Errore di compilazione di Microsoft VBScript (0x800A03F6)
Previsto 'End'![]()
/prova/admin/Upload_Database.asp, line 37
Else)
Questa è il codice:
codice:<% Function InsertDbValues(Upload) With Upload .Database.Fields("Data") = .Form("Data") .Database.Fields("Titolo") = .Form("Titolo") .Database.Fields("Notizia") = .Form("Notizia") .Database.Fields("Percorso") = .GetFileName End With End Function Dim oUpload Set oUpload= new cUpload With oUpload .SetDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("../database/db_admin.mdb"),"SELECT Top 1 * FROM tb_offerteIT" .EnabledAspUpload = False .EnabledImageSize = False .EnabledLog = False .AutoRename = True .Overwrite = False .SetPath "..\foto\fotonews\" .Load .UploadOnly "Images" If Not .EOF then .Database.Open() While Not .EOF .Save Response.Write "Dati inseriti e la foto " & .GetFileName &" è stata salvata " Response.write ("Ritorna Indietro ") InsertDbValues(Upload) .Database.Fields("Percorso") = .GetFileName .Database.AddNew() .MoveNext Wend End if Else .database.Open() InsertDbValues(Upload) .Database.AddNew() End With Set oUpload = Nothing %>

Rispondi quotando