SAFile Object

The SAFile object object represents a single uploaded file. It contains various methods and properties that let you manipulate the upload.

An instance of the SAFile object is automatically created by the principal FileUp object when an upload is in progress. You can create an instance of the SAFile object independently so that you can access several of its general-purpose functions, even if there is no upload in progress.

To instantiate and use the SAFile object in ASP:

ASP <%
'--- Create a new SAFile object Dim file
Set file = Server.CreateObject("SoftArtisans.SAFile")
%>
ASP <%
'--- Get an existing SAFile object from an upload Dim file
Set file = fileUpload.Form("MyFile1")
%>

In ASP.NET it is not possible to instantiate a new SAFile object. You can only get an existing SAFile object from the Form collection of an upload.

(ASP.NET samples assume the inclusion of the SoftArtisans.Net namespace.)

C# SaFile file = (SaFile)fileUpload.Form["MyFile"];
VB.NET Dim file As SaFile = CType(fileUpload.Form("MyFile"), SaFile)

After that, all methods and properties are available to you.

SAFile Methods

SAFile Properties

Copyright © 2010 SoftArtisans, Inc. All rights reserved.