Path Property


 Object: SoftArtisans.FileUp
 Syntax: Path
 Type: String
 Read/Write: Read/Write
 Description: This property defines the default directory for saving files. It also defines the default directory for caching files before a final save is executed. FileUp must be able to write to this directory.

When the first upload reaches the server, FileUp will search for a writable Temp directory, and assign it to the Path property. FileUp will check the following: the TEMP environment variable, C:\Windows\Temp, C:\Winnt\Temp, C:\Temp, C:\tmp, and GetTempDir.

If FileUp does not find a writable Temp directory, and the Path property is not set in script, an error will occur. A Path assignment in script will overwrite FileUp's default Path value.

If you set Path, you can still save the file to a different location. When using the SaveAs method, specify a new complete path and file name. In this scenario, the upload is cached in the default path. When the SaveAs method is executed, the file is 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.

Note: To change the system's default directory for cached files (the first directory FileUp will try to use as a default cache), reset the TEMP environment variable, as follows:

  • Open the Control Panel.
  • Select System.
  • Select the Advanced tab.
  • Click Environment variables...
  • Select TEMP from the System Variables list.
  • Click Edit.
  • Enter a new Variable Value, and click Ok.
 Examples: The following caches and saves the upload on the Web server at C:\Uploads.
<%
Set upl = Server.CreateObject("SoftArtisans.FileUp")
...
upl.Path = "C:\Uploads"
...
upl.Save
... %>
The following caches and saves the upload to a network shared drive.
<%
Set upl = Server.CreateObject("SoftArtisans.FileUp")
...
upl.Path = "\\FileServer\Uploads"
...
upl.Save
... %>
  • The following caches the upload on the Web server and saves it to a network shared drive.
    <%
    Set upl = Server.CreateObject("SoftArtisans.FileUp")
    ...
    upl.Path = "C:\Temp"
    ...
    upl.SaveAs "\\FileServer\Uploads" & upl.form("file1").ShortFileName
    ... %>
  •  


    Copyright © 2004 SoftArtisans, Inc. All rights reserved.