codice:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
percorso = "/public/fotocatalogo/prodotti/"
ByteRicevuti = Request.TotalBytes
if ByteRicevuti > 0 then
DatiRicevuti = Request.BinaryRead(ByteRicevuti)
For i = 1 To lenB(DatiRicevuti)
FileBinario = FileBinario & chr(ascB(midB(DatiRicevuti,i,1)))
Next
FirmaFile = left(FileBinario,instr(FileBinario,"" & vbCrLf)-1)
ArrPezzi = split(FileBinario,FirmaFile)
for item = 1 to ubound(ArrPezzi)-1
Inizio = instr(ArrPezzi(item),"" & vbCrLf & "" & vbCrLf)
Intestazione = left(ArrPezzi(item),Inizio-1)
Inizio = Inizio + len("" & vbCrLf) + len("" & vbCrLf)
ContenutoFile = mid(ArrPezzi(item),Inizio,len(ArrPezzi(item))-Inizio-1)
if instr(Intestazione,"campoofferta") > 0 then
campoofferta = "S"
else
campoofferta = "N"
end if
if instr(Intestazione,"campoabilitato") > 0 then
campoabilitato = "S"
else
campoabilitato = "N"
end if
if instr(Intestazione,"campocategoria") > 0 then
campocategoria = ContenutoFile
end if
if instr(Intestazione,"camponome") > 0 then
camponome = ContenutoFile
end if
if instr(Intestazione,"campocodice") > 0 then
campocodice = ContenutoFile
end if
if instr(Intestazione,"campoprezo") > 0 then
campoprezzo = ContenutoFile
end if
if instr(Intestazione,"campoprezzoofferta") > 0 then
campoprezzoofferta = ContenutoFile
end if
if instr(Intestazione,"campodisponibilita") > 0 then
campodisponibilita = ContenutoFile
campodisponibilita = replace(campodisponibilita,chr(13),"
")
end if
if instr(Intestazione,"campodescrizione") > 0 then
campodescrizione = ContenutoFile
campodescrizione = replace(campodescrizione,chr(13),"
")
end if
if instr(Intestazione,"valore_id") > 0 then
id = ContenutoFile
end if
if instr(Intestazione,"fotominipresente1") > 0 then
fotominipresente1 = ContenutoFile
end if
if instr(Intestazione,"fotominipresente2") > 0 then
fotominipresente2 = ContenutoFile
end if
if instr(Intestazione,"fotominipresente3") > 0 then
fotominipresente3 = ContenutoFile
end if
if instr(Intestazione,"fotomediapresente") > 0 then
fotomediapresente = ContenutoFile
end if
if instr(Intestazione,"fotograndepresente1") > 0 then
fotograndepresente1 = ContenutoFile
end if
if instr(Intestazione,"fotograndepresente2") > 0 then
fotograndepresente2 = ContenutoFile
end if
if instr(Intestazione,"fotograndepresente3") > 0 then
fotograndepresente3 = ContenutoFile
end if
if instr(Intestazione,"fotomini1") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotomini1 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotomini1), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotomini2") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotomini2 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotomini2), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotomini3") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotomini3 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotomini3), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotomedia") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotomedia = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotomedia), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotogrande1") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotogrande1 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotogrande1), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotogrande2") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotogrande2 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotogrande2), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
if instr(Intestazione,"fotogrande3") > 0 then
i = instr(Intestazione,"filename=")
j = instr(i + 10,Intestazione,chr(34))
NomeUpload = mid(Intestazione,i + 10,j-i-10)
i = instrRev(NomeUpload,"\")
if i<>0 then
NomeFile = mid(NomeUpload,i + 1)
else
NomeFile = NomeUpload
end if
if i<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
fotogrande3 = replace(NomeFile," ","")
Set textStream = FSO.CreateTextFile(server.mappath(percorso & fotogrande3), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if
next
if fotomini1 = "" then
fotomini1 = fotominipresente1
end if
if fotomini2 = "" then
fotomini2 = fotominipresente2
end if
if fotomini3 = "" then
fotomini3 = fotominipresente3
end if
if fotomedia = "" then
fotomedia = fotomediapresente
end if
if fotogrande1 = "" then
fotogrande1 = fotograndepresente1
end if
if fotogrande2 = "" then
fotogrande2 = fotograndepresente2
end if
if fotogrande3 = "" then
fotogrande3 = fotograndepresente3
end if
dim co
set co = server.createObject("ADODB.Connection")
co.Open "Driver={MySQL ODBC 3.51 Driver};server=62.149.112.23;port=3306;Database=Sql35582_1;UID=Sql35582;PWD=(8LMkRD-;"
strq = "UPDATE catalogo SET categoria ='"& campocategoria & "', nome ='" & camponome & "', codice='" & campocodice &"', prezzo='" & campoprezzo & "', prezzoofferta='" & campoprezzoofferta & "', offerta='" & campoofferta & "', abilitato='" & campoabilitato & "', disponibilita='" & campodisponibilita & "', descrizione='" & campodescrizione & "', fotomini1='" & fotomini1 & "', fotomini2='" & fotomini2 & "', fotomini3='" & fotomini3 & "', fotomedia='" & fotomedia & "', fotogrande1='" & fotogrande1 & "', fotogrande2='" & fotogrande2 & "', fotogrande3='" & fotogrande3 & "'WHERE id=" & id
co.execute (strq)
Response.redirect ("catalogo.asp")
End if
%>
</body>
</html>