Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 70
Product
FileUp
Version
2.x
Title
SAFile object's Path property requires trailing backslash
Problem
If you do not use a trailing backslash when setting the Path property of the SAFile object, all files created will concatenate the last portion of the filename and place the file in the intended folder's parent folder.

To recreate the problem, do the following:

1. Create a file called PathTest.asp. Enter the following code:

<%
Set objFile = Server.CreateObject("SoftArtisans.SAFile")
objFile.Path = "C:\Temp"
objFile.Create "oraMutantur.txt"
%>
2. Run PathTest.asp.

3. Note that you now have a file in your root directory called TemporaMutantur.txt.

Solution
Use a trailing backslash when setting the Path property. Thus, the code above would be changed to:
<%
Set objFile = Server.CreateObject("SoftArtisans.SAFile")
objFile.Path = "C:\Temp\"
objFile.Create "oraMutantur.txt"
%>
The script will then correctly create a file in your Temp directory named oraMutantur.txt.
Created : 12/1/2002 12:00:00 AM (last modified : 6/21/1999 6:53:00 PM)
Rate this article!
Comments