Ciao a tutti,
sono un nuovo iscritto e vorrei fare i complimenti a tutti per questo magnifico sito e per la disponibilità di tutti gli inscritti.
Ho un piccolo problemino con un sito web che permette l'upload dei file via http.
Tale sito si trova su Windows Server 2003 Advanced Server con SP2 ed è composto dalla seguente pagina htm (default.htm)
____________
<form action="upload.asp" method="post" enctype="multipart/form-data">
CAMPO TESTO
<input type="text" name="testo1">
FILE
<input type="file" name="file1">
<input type="submit" value="Upload">
</form>
____________
che richiama la seguente pagina asp (upload.asp) per uploadare i file e inserirli nella cartella "received"
____________
<%
percorso = "/received/"
Server.ScriptTimeout=120 '120=2 minuti
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,"testo1") > 0 then
testo1 = 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")
Upload1 = True
DimensioneFile1 = len(ContenutoFile)
EstensioneFile1 = right(ContenutoFile,3)
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
next
Response.Write "Il valore immesso nella testo1 è " & testo1 & "
"
If Upload1 = true then
Response.Write "
La dimensione del file che hai uploadato è di " & DimensioneFile1*0.001 & "kb"
Response.Write "
Grazie di aver inviato il tuo file"
End If
End if
%>
______________
Il problema è che non riesco a fare l'upload per i file che superano i 100KB di dimensione.
Come mai?
C'è qualcosa che non va nel codice?
L'errore che mi da è una pagina così fatta
________________
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
Please try the following:
Open the home page, and then look for links to the information you want.
Click the Refresh button, or try again later.
Click Search to look for information on the Internet.
You can also see a list of related sites.
HTTP 500 - Internal server error
Internet Explorer
_____________________
Grazie a tutti per le risposte.![]()
Ciao