Questo script compie l'upload nella cartella "public", che si trova nella root del sito, di un file chiamato "userfile" (ho usato lo stesso nome in modo che possa copiare lo script esattamente così com'è....), e dopo l'upload ti restituisce un messaggio di operazione andata a buon fine con un pulsante, cliccando sul quale chiudi la finestra del messaggio e ritorni alla pagina di partenza ............... se ti serve posto anche il relativo form.

codice:
<%
Server.ScriptTimeout = 200

'variabili di configurazione
Dim folder
folder = "/public"  			'directory sul server con accesso in scrittura
'fine variabili di configurazione

Response.Expires=0
Response.Buffer = TRUE
Response.Clear

Sub BuildUploadRequest(RequestBin)
	PosBeg = 1
	PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
	boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
	boundaryPos = InstrB(1,RequestBin,boundary)
		Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
		Dim UploadControl
		Set UploadControl = CreateObject("Scripting.Dictionary")
		'Get an object name
		Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition"))
		Pos = InstrB(Pos,RequestBin,getByteString("name="))
		PosBeg = Pos+6
		PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
		Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
		PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename="))
		PosBound = InstrB(PosEnd,RequestBin,boundary)
			If  PosFile<>0 AND (PosFile<PosBound) Then
			PosBeg = PosFile + 10
			PosEnd =  InstrB(PosBeg,RequestBin,getByteString(chr(34)))
			FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
			UploadControl.Add "FileName", FileName
			Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
			PosBeg = Pos+14
			PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
			ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
			UploadControl.Add "ContentType",ContentType
			PosBeg = PosEnd+4
			PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
			Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
			Else
			Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
			PosBeg = Pos+4
			PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
			Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
		End If
		UploadControl.Add "Value" , Value	
		UploadRequest.Add name, UploadControl	
		BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
	Loop
End Sub
Function getByteString(StringStr)
 For i = 1 to Len(StringStr)
 	char = Mid(StringStr,i,1)
	getByteString = getByteString & chrB(AscB(char))
 Next
End Function
Function getString(StringBin)
 getString =""
 For intCount = 1 to LenB(StringBin)
	getString = getString & chr(AscB(MidB(StringBin,intCount,1))) 
 Next
End Function

byteCount = Request.TotalBytes

RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary")

BuildUploadRequest  RequestBin

contentType = UploadRequest.Item("userfile").Item("ContentType")
filepathname = UploadRequest.Item("userfile").Item("FileName")
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
session("userfile") = filename
value = UploadRequest.Item("userfile").Item("Value")

'Create FileSytemObject Component
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")

'Create and Write to a File
Set MyFile = ScriptObject.CreateTextFile(Server.mappath(folder)&"\"&filename)
 
For i = 1 to LenB(value)
	MyFile.write chr(AscB(MidB(value,i,1)))
Next 

MyFile.Close
%>

<html>
<head>
	<title>UPLOAD FILE</title>
	
	<script language="JavaScript">
     function close_reload() {
       window.opener.location.reload();
	   window.close();
  	}
	</script>



</head>
<body>



 <center><div>File caricato</div>
 

</p>
<div>Chiudi finestra</div></center>
</body>
</html>