codice:
<%
percorso = "/public/"
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,"serataLM") > 0 then
testo1 = ContenutoFile
end if
if instr(Intestazione,"dataLM") > 0 then
testo2 = ContenutoFile
end if
if instr(Intestazione,"descrizioneLM") > 0 then
testo3 = ContenutoFile
end if
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)
NomeFile1 = NomeFile
if imgsmall <> "" then
imgbig = NomeFile
else
imgsmall = NomeFile
end if
Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
i2 = instr(Intestazione,"filename = ")
j2 = instr(i2 + 10,Intestazione,chr(34))
NomeUpload2 = mid(Intestazione,i2 + 10,j2-i2-10)
i2 = instrRev(NomeUpload2,"\")
if i2<>0 then
NomeFile2 = mid(NomeUpload2,i2 + 1)
else
NomeFile2 = NomeUpload2
end if
if i2<>0 then
Set FSO = CreateObject("Scripting.FileSystemObject")
Upload2 = True
DimensioneFile2 = len(ContenutoFile)
EstensioneFile2 = right(ContenutoFile,3)
NomeFile22 = NomeFile2
imgbig = NomeFile22
Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile22), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
next
End if
serata = Replace(testo1,"'","\'")
data = Replace(testo2,"'","''")
descrizione = Replace(testo3, Chr(34),"")
if instr(Intestazione,"descrizioneLM") > 0 then
testo3 = ContenutoFile
response.write testo3
response.end
end if
' Mappaggio del database
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("/mdb-database/database.mdb")
Conn.Open strConn
sql_inserimento = "INSERT INTO foto_serate ( data, serata, descrizione, foto, fotogrande) VALUES ('" & data & "', '" & serata & "', '" & descrizione & "', '" & imgsmall & "', '" & imgbig & "');"
Conn.Execute sql_inserimento
' Chiusura del database
conn.Close
set conn = Nothing
%>
Sempre l'errore inziale