<%@language="VBScript"%> <% Response.Expires = -1 %> <% Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload") mySmartUpload.Upload For each file In mySmartUpload.Files start = start + 1 If not file.IsMissing Then if not lcase(file.fileext) = "jpg" and not lcase(file.fileext) = "gif" and not lcase(file.fileext) = "swf" then chyba = chyba & "Obrázek " & start & " nemá správný formát JPG, GIF nebo Flash" & "\n" else set f = server.createobject("scripting.filesystemobject") 'smazání starého baneru cesta = Server.MapPath("../data_shopy/baner_uvod/" & application("nazev_shop") & "/") & "\" if f.fileexists(cesta & start & "." & mySmartUpload.Form("pripona" & start).values) = true then f.deletefile (cesta & start & "." & mySmartUpload.Form("pripona" & start).values), true end if 'uložení nového baneru file.SaveAs(cesta & start & "." & lcase(file.fileext)) 'uložení přípony Set rs = CreateObject("ADODB.RecordSet") strSQL = "SELECT pripona FROM shop_baner WHERE id_shop_baner = " & start & " AND id_shop = " & application("id_shop") rs.Open strSQL, conn, 2, 3 rs("pripona") = lcase(file.fileext) rs.update rs.close end if End If Next 'uložení údajů do databáze Set rs = CreateObject("ADODB.RecordSet") strSQL = "SELECT * FROM shop_baner WHERE id_shop = " & application("id_shop") & " ORDER BY id_shop_baner" rs.Open strSQL, conn, 2, 3 do while not rs.eof 'generování odkazu text3 = mySmartUpload.Form("nazev" & rs("id_shop_baner")).values %> <% rs("nazev") = "" rs("odkaz") = replace(mySmartUpload.Form("odkaz" & rs("id_shop_baner")).values,"http://","") if mySmartUpload.Form("zobrazit" & rs("id_shop_baner")).values = "1" then rs("zobrazit") = true else rs("zobrazit") = false end if rs.update rs.movenext loop rs.close conn.close set mysmartupload = nothing set f = nothing if chyba = "" then chyba = "Uloženo" end if session("reload") = "1" Response.clear response.redirect "shopy-banery.asp?chyba=" & chyba %>