AspFile
1.x
About
AspFile
AspFile
is a component in the AspLib series. This component comes packaged
with other components of the AspLib series. The components are not
available for purchase seperately. AspFile provides access to commonly
need file functions including:
- File
copy, move, delete and rename
- Directory
listings
- File
attributes and sizes
- Directory
creation and deletion
- Creating
unique file names
AspFile
Installation
To
use this ASP component move the DLL into a subdirectory (like
\winnt\system32 for NT or \windows\system for Win95). Please use
the version of regsvr32 that is included with this component or
the version that comes with Microsoft ASP (they are the same version).
To
register the component on the system change to the directory where
you installed the DLL and type:
regsvr32
aspfile.dll
Simple
Example
The
following code demonstrates how to use AspFile from VBScript to
determine if a file exists or not.
Set FileObj = Server.CreateObject("AspFile.FileObj")
if FileObj.FileExists (strTempFile1) then
DoWhatever
end if
About
purchasing ASPLib
- The
registration license fee covers only one CPU per license.
About
Upgrades
- Users
can upgrade for free for minor version changes. For example, upgrades
from version 1.00 to 1.99 are free. The upgrade from 1.99 to 2.0
may carry an additional license fee.
How
to get upgrades
- The
latest version of the components are always available at http://www.serverobjects.com/products.htm.
If a fee is associated with obtaining the upgrade it will be noted
on that page.
Upgrade
Instructions
To
upgrade the component from a previous version please follow these
steps:
- Stop
all IIS related services or any process that has the component
in use.
- Change
to the directory where the component is located and type "regsvr32
/u aspfile.dll"
- Move
the new copy of aspfile.dll to the current directory and type
"regsvr32 aspfile.dll"
- Restart
IIS
Common
Problems
Server
object error 80040154.
This is the most common error reported. The error means that ASP
could not create the object. Causes include:
- You
never ran regsvr32 on the DLL. See installation section of this
document.
- You
registered the DLL with regsvr32 in one subdirectory and moved
it to another.
- IIS
does not have proper security permissions to access the DLL or
the directory you installed it to. See the ASP FAQ (http://www.signmeup.com/faq/)
for information on changing security.
- Your
server may be running low on memory.
- Your
evaluation copy has expired. If you purchased the product be sure
you followed directions to install your product key.
Note:
Some users have reported that restarting the server after registering
the DLL was required to use the component. This should not be necessary
but reportedly works in a few cases.
Server
object error 'ASP 0177:800401f3'.
This error means "Invalid class string" -- in other words
the call to CreateObject failed because the name object cannot be
found by the OLE sub-system. Causes include:
- You
really didn't run regsvr32 on the server after all.
- You
ran regsvr32 but it reported an error.
- Someone
modified security on part of the registry that's preventing the
OLE subsystem from reading all or part of the HKEY_CLASSES_ROOT
tree.
- The
name of the object you are trying to create was mispelled or is
incorrect.
Technical
Support
If
you require technical support please see our tech support page at
http://www.serverobjects.com/support.htm
AspFile
Component Properties
| Property |
Description |
| Error |
If any errors occur during one of the methods Error property
will save the Windows error code that is returned by GetLastError(). |
| FileCount |
The FileCount property returns the number of files found during
a call to the GetFileList method. |
| DateTimeFormat |
DateTimeFormat allows you to change the formatting of date/time
strings. The default value is "hh:mm am/pm mmm dd, yyyy".
DateTimeFormat is used during calls to the GetFileList method. |
| Expires |
Returns the date/time evaluation copies of this component
will cease to function. Licensed versions return N/A. |
| RegisteredTo |
Returns the name of the company or individual the component
is licensed to. |
| Version |
Returns the internal component version number of the component. |
AspFile
Component Methods
| Method |
Parameters |
Return Value |
Description |
| CopyFile |
strSource, strDest |
True/False |
Copies the file from the strSource
to the strDestination. |
| DeleteFile |
strFileName |
True/False |
Deletes the specified file from disk. strFileName should include
the literal path of the file. |
| FileExists |
strFileName |
True/False |
Returns true if strFileName exists and false if it does not.
strFileName should include the literal path of the file. |
| MoveFile |
strSource, strDestination |
True/False |
Moves the file from strSource to strDestination. |
| RenameFile |
strOrigName, strNewName, bolDeleteExisting |
True/False |
Renames the file strOrigName to strNewName and erases any
old copy of strNewName if bolDeleteExisting is true. |
| GetFileSize |
strFileName |
Integer |
Returns the number of bytes in strFileName. strFileName should
include the literal path of the file. |
| GetFileDateTime |
strFileName, strDateTimeMask |
String |
Returns the date and time for strFileName using the mask provided
in strDateTimeMask. strFileName includes the literal path of
the file. |
| GetFileAttrs |
strFileName |
Integer |
Returns the file attributes for strFileName. strFileName should
include the literal path of the file. |
| SetFileAttrs |
strFileName, intAttributes |
True/False |
Sets the file attributes for strFileName using intAttributes.
strFileName should include the literal path of the file. |
| GetUniqueFileName |
strPath, strPrefix: |
String |
Returns a unique filename based upon the specified path and
prefix. |
| CreateFileOfSize |
strFileName, intSize: |
True/False |
Creates and empty file of intSize with a name provided by
strFileName. strFileName should include the literal path of
the file. |
| GetFileList |
strPath, strMask, bolIncludeDirs |
Variant array of variant array |
Returns a variant list of files for the specified strPath
and strMask. If bolIncludeDirs is true, directories will also
be included in the listing. |
| CreateDirectory |
strDirectoryName |
True/False |
Creates a directory of strDirectoryName. |
| RemoveDirectory |
strDirectoryName |
True/False |
Removes a directory of stDirectoryName. If the O/S is unable
to remove the directory for some reason, the method will return
false. |
| GetDriveType |
strDrive |
SmallInteger |
Returns an integer value indicating what type of drive strDrive
is. The return value are:
- DRIVE_UNKNOWN = 0
- DRIVE_NO_ROOT_DIR = 1
- DRIVE_REMOVABLE = 2
- DRIVE_FIXED = 3
- DRIVE_REMOTE = 4
- DRIVE_CDROM = 5
- DRIVE_RAMDISK = 6
|
| GetTempPath |
N/A |
String |
Returns the Temp path configured by the O/S. |
|