codice:
<%
'Controllo il passaggio delle informazioni
messaggio = ""
Response.Buffer = True
server.ScriptTimeout=3600
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Upload
galleria_titolo = trim(mySmartUpload.Form("galleria_titolo"))
if galleria_titolo &"[]" = "[]" then
messaggio = "Il campo Titolo non è stato compilato"
end if
if messaggio = "" then
percorso_galleria_foto = server.mappath("/public/gallerie/")
galleria_foto = ""
For each file In mySmartUpload.Files
If not file.IsMissing Then
galleria_foto = data_upload &"."& file.FileExt
file.SaveAs(percorso_galleria_foto & galleria_foto)
else
messaggio = "Il campo Foto non è stato compilato"
end if
Next
end if
Set mySmartUpload = nothing
<%if messaggio <> "" then
if galleria_foto <> "" then
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.fileExists (server.mappath(percorso_galleria_foto & galleria_foto)) then
fso.DeleteFile (server.mappath(percorso_galleria_foto & galleria_foto))
end if
Set fso = nothing
end if%>
[img]/images/alert.gif[/img]Attenzione:
<%=messaggio%></p>
[img]/images/go_verde_reverse.gif[/img]Torna indietro</p>
<%else
response.write("Ok!")
end if
%>