Breve estratto.
Robycodice:<% messaggio = "" Response.Buffer = True server.ScriptTimeout=3600 Set oUpload = new cUpload 'oUpload.AutoRename=False 'oUpload.OverWrite=True oUpload.Upload oUpload.SetPath "/public/" news_titolo = trim(oUpload.Form("news_titolo")) news_testo = trim(oUpload.Form("news_testo")) if news_titolo &"[]" = "[]" then messaggio = "Il campo Titolo non è stato compilato" end if if news_testo &"[]" = "[]" then messaggio = "Il campo Testo non è stato compilato" end if if len(news_data) <> 10 then messaggio = "Il campo Data non è stato compilato" end if if messaggio = "" then news_foto_1 = "": news_foto_2 = "": news_foto_3 = "": news_foto_4 = "": news_foto_5 = "" 'Campo di tipo file; lascio il ciclo in caso in cui si voglia dare in futuro la possibilità di aggiungere più di un file If Not oUpload.EOF then oUpload.MoveFirst Do While Not oUpload.EOF if oUpload.Files("InputName") = "news_foto_1" then news_foto_1 = data_upload &"1."& oUpload.Files("ext"):oUpload.SaveAs(news_foto_1) if oUpload.Files("InputName") = "news_foto_2" then news_foto_2 = data_upload &"2."& oUpload.Files("ext"):oUpload.SaveAs(news_foto_2) if oUpload.Files("InputName") = "news_foto_3" then news_foto_3 = data_upload &"3."& oUpload.Files("ext"):oUpload.SaveAs(news_foto_3) if oUpload.Files("InputName") = "news_foto_4" then news_foto_4 = data_upload &"4."& oUpload.Files("ext"):oUpload.SaveAs(news_foto_4) if oUpload.Files("InputName") = "news_foto_5" then news_foto_5 = data_upload &"5."& oUpload.Files("ext"):oUpload.SaveAs(news_foto_5) oUpload.MoveNext Loop end if end if Set oUpload = nothing %>

Rispondi quotando