Upload | no component outputfile.asp
<%
' Author Philippe Collignon
' Email PhCollignon@email.com
Response.expires=0
Response.Buffer = TRUE
Response.Clear
' Response.BinaryWrite (Request.BinaryRead (request.totalbytes))
ByteCount = Request.TotalBytes
' Response.BinaryWrite (Request.BinaryRead (Varbytecount))
Requestbin = Request.BinaryRead (ByteCount)
Dim Uploadrequest
Set uploadrequest = CreateObject ("Scripting.Dictionary")
Builduploadrequest Requestbin
email = uploadrequest.item ("email"). Item ("Value")
ContentType = Uploadrequest.item ("blob"). Item ("ContentType")
Filepathname = Uploadrequest.item ("blob"). Item ("FileName")
filename = right (Filepathname,len (filepathname)-instrrev (filepathname, "\")
Value = Uploadrequest.item ("blob"). Item ("Value")
' Create filesytemobject Component
Set ScriptObject = Server.CreateObject ("Scripting.FileSystemObject")
' Create and Write to a ' File
Pathend = Len (Server.MapPath (Request.ServerVariables ("Path_info"))-14
Set MyFile = Scriptobject.createtextfile (Left (Server.MapPath (Request.ServerVariables ("Path_info")), Pathend) & uploaded "&filename)
For i = 1 to LenB (value)
Myfile.write chr (AscB (MidB (value,i,1))
Next
Myfile.close
%>
<b>uploaded file: </b><%= "uploaded" &filename%><BR>
<!--#include file= "upload.asp"-->
Transferred from Asptoday