Usavo questo script per uploadare una foto e caricare diversi campi di un form per aggiornare il database, di punto in bianco non mi carica più la foto (server Aruba) e non mi da nessun errore.
Da alcune prove che ho fatto sembra che non venga più riconosciuto il campo "file1" (che sarebbe la foto da uploadare), però c'è....


<%
Response.Buffer = True

Server.ScriptTimeOut = 1200 'secondi

idmerc = request.querystring("idmerc")
lang = request.querystring("lang")

'upload della locandina

percorso = "public\fotomercatino\"& idmerc &"\"
cartella = "public\fotomercatino\"& idmerc
cartella = Server.MapPath (cartella)

' se non esiste crea una cartella per le foto

Set fso = CreateObject("Scripting.FileSystemObject")

if not (fso.FolderExists (cartella)) then

Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder (cartella)

end if

'inizio upload

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)

'recupero campi del form

if instr(Intestazione,"vendo") > 0 then
vendo = ContenutoFile
end if

if instr(Intestazione,"tipo") > 0 then
tipo = ContenutoFile
end if

if instr(Intestazione,"marca") > 0 then
marca = ContenutoFile
marca = replace(marca,"'","''")
end if

if instr(Intestazione,"modello") > 0 then
modello = ContenutoFile
modello = replace(modello,"'","''")
end if

if instr(Intestazione,"anno") > 0 then
anno = ContenutoFile
end if

if instr(Intestazione,"descrita") > 0 then
descrita = ContenutoFile
descrita = replace(descrita,"'","''")
end if

if instr(Intestazione,"descreng") > 0 then
descreng = ContenutoFile
descreng = replace(descreng,"'","''")
end if

if instr(Intestazione,"prezzo") > 0 then
prezzo = ContenutoFile
end if

if instr(Intestazione,"rec1") > 0 then
rec1 = ContenutoFile
end if

if instr(Intestazione,"rec2") > 0 then
rec2 = ContenutoFile
end if

if instr(Intestazione,"datains") > 0 then
datains = ContenutoFile
end if

if instr(Intestazione,"datarinn") > 0 then
datarinn = ContenutoFile
else
datarinn = datains
end if



' Qui recupero il file da uploadare (se presente) e lo scrivo sul server

if instr(Intestazione,"file1") > 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)

NomeFile1 = NomeFile
EstFile1 = lcase(right(NomeFile1,3))

if EstFile1<>"jpg" then
response.redirect "errorefotoupM.asp?lang="& lang &"&idmerc="& idmerc
else
foto = true
NomeFile1 = NomeFile
Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False)
textStream.Write ContenutoFile
textStream.Close
Set textStream = Nothing
Set FSO = Nothing
end if
end if

end if

next
end if

'inserimento campi dell'inserzione
if foto then
strsql="UPDATE mercatino SET foto="& foto &", vendo="& vendo &", tipo="& tipo &", marca='"& marca &"', modello='"& modello &"', anno='"& anno &"', descrita='"& descrita &"', descreng='"& descreng &"', prezzo='"& prezzo &"', rec1='"& rec1 &"', rec2='"& rec2 &"', datarinn='"& datarinn &"', datains='"& datains &"' WHERE idmerc="& idmerc &""
else
strsql="UPDATE mercatino SET vendo="& vendo &", tipo="& tipo &", marca='"& marca &"', modello='"& modello &"', anno='"& anno &"', descrita='"& descrita &"', descreng='"& descreng &"', prezzo='"& prezzo &"', rec1='"& rec1 &"', rec2='"& rec2 &"', datarinn='"& datarinn &"', datains='"& datains &"' WHERE idmerc="& idmerc &""
end if
%>

<%
Conn.close
set Conn = nothing

response.redirect "Mannmerc.asp?idmerc="& idmerc &"&lang="& lang
%>