Class: SoftArtisans.FileUp
Property: Path
Type: String
Read/Write
Description: This property defines the default directory for storing files. It also defines the location of the cache files before a final save is executed.
SA-FileUp must be able to write into this directory.
For this property to have effect, it must be set before any form elements are referenced. Once the first form element is referenced, the entire HTTP Post stream must be read and the uploaded files included in the stream must be cached.
If no value is set, SA-FileUp will use the system-defined Temporary Path (which is returned by the WIN32 GetTempPath() routine). Typically, this is "C:\TEMP".
Even if you specify a default path, it is still possible to save the file to a different location. When using the SaveAs method, specify a new complete path and filename. In this scenario, the upload will be cached in the default path. When the SaveAs method is executed, the file will be moved from the default path to the new destination. This works even if the new destination is on a different disk or on a network share.
Example:
<%
Set upl = Server.CreateObject("SoftArtisans.FileUp")
'---
'--- Set the default path to store uploaded files.
'--- This should be set immediately after instanciation.
'---
upl.Path = "c:\temp"
'---
'--- Determine if the file upload is empty. Since this is the
'--- first reference to data on the form, this will cause the
'--- entire HTTP Post stream to be read, parsed and processed.
if upl.IsEmpty Then %>
... %>