Ciao a tutti ho trovato in rete questo script, che con IE mi funzione perfettamente e riesco a modificarlo per scrivere nel database mentre con Firerefox, non lo processa. Potreste vedere voi se trovate l'errore?
form.asp
codice:<center><form action="upload.asp" method="POST" enctype="multipart/form-data" > Titolo foto <input type="text" name="testo1" size="31"> File da uplodare <input type="file" name="file1" size="26"> Attenzione compilare il "Titolo della foto", se lasciato vuoto apparirà "Foto Senza Titolo"</p> <input type="submit" value="Upload"><input type="hidden" name="testo2" value="<%=now%>"></form> </center>
upload.asp
Ripeto con IE nessun problema, con firefox si.codice:<% percorso = "/public/foto/" 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,"testo0") > 0 then testo0 = replace(trim((ContenutoFile)),"'","'") end if if instr(Intestazione,"testo1") > 0 then testo1 = replace(trim((ContenutoFile)),"'","'") end if if instr(Intestazione,"testo2") > 0 then testo2 = ContenutoFile end if 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") DimensioneFile1 = len(ContenutoFile) EstensioneFile1 = right(ContenutoFile,3) Randomize() genero=Int(10000*Rnd( )) NomeFile1 = genero&NomeFile Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False) textStream.Write ContenutoFile textStream.Close Set textStream = Nothing Set FSO = Nothing Upload1 = True end if end if next If Upload1 = True then Response.Write "<center> Caricamento riuscito! La dimensione della foto che hai uploadato è di " & DimensioneFile1*0.001 & "kb" Response.Write " Il titolo della foto "& testo1&" , il tuo file è stato registrato sul database il "&now()&"." End if End if %>

Rispondi quotando