Class: SoftArtisans.FileUp
Method: SaveBinaryAs ([in] Filename)
Description: This method saves the raw HTTP Post stream to the web server's hard disk, without any interpretation.
If no path is specified ("file.ext"), the value of the Path property is used. For more efficient processing, it is recommended that you use the Path property before saving any files.
When a path is specified ("c:\uploads\file.ext"), the path must contain the complete path. Relative paths cannot be used.
The SaveBinaryAs method cannot be used in conjunction with any other method that interprets HTTP Post stream, such as getting form values, or save a decoded upload to disk. One or the other must be used.
Example:
<%
'---
'--- Instanciate SA-FileUp
'---
Set upl = Server.CreateObject("SoftArtisans.FileUp")
'---
'--- Set the default path to store uploaded files. This step is not
'--- strictly necessary, but performance is better if you specify it.
'---
upl.Path = "c:\temp"
'---
'--- Set the filename. You can put any valid filename here.
'---
filename = "upload.tst" %>
The server's path for uploaded files is: <%=upl.Path %><BR>
Saving the file to : <%=filename%><BR>
<%
on error resume next
'---
'--- Save the file now
'---
upl.SaveBinaryAs filename
if Err <> 0 Then %>
An error occurred when saving the file on the server.
... %>