Relax. ASP.NET Web Hosting without the hassles. Ring 1300 787 698
(
Skip Navigation Links : Knowledge Base : ASP : Uploading without components

Uploading without components 

Uploading files through ASP can be done through the myriad of components available.

As an alternative, an ASP upload script has been put together that doesn't require any components.

Download

http://www.studiocoast.com.au/downloads/aspupload.zip

Installation Instructions

Simply drop the three files in to your ASP site

How to use

The zip file contains an example page and script with the following code:

<!--#include file="clsUpload.asp"-->
<%

 

set fUpload = New clsUpload
set file = fUpload.Fields("file")
 set BinaryStream = CreateObject("ADODB.Stream")

szName = file.Filename
szSize = file.Length

lBinBytes = file.ASCII2Bytes(file.BinaryData)

BinaryStream.Type = 1
BinaryStream.Open
BinaryStream.Write lBinBytes
BinaryStream.SaveToFile Server.MapPath(szName), 2
BinaryStream.Close

set BinaryStream = nothing
set file = nothing
set fUpload = nothing

%>

Disclaimer

This component and code is provided as-is without any warranty or support.

 

 

)