Hello Peter,
Is there a function to determine the amount of free space (or space used) on the web server? For example, just say I wanted to check the amount of space I'm using with my own domain name (or even in localhost) without having to check it in an ftp program. I'm looking for a function that I can use in my demo app that will display the figure on the app's web pages.
If its a winbox and scripting host is enabled then try this (the wrapping will probably wreck it):
<cfobject type="COM" action="create" class="Scripting.FileSystemObject" name="Application.fso">
<table align="center" cellspacing="0" cellpadding="3" border="1" width="100%">
<cfset driveSpace=StructNew()>
<cfloop collection="#Application.fso.drives#" item="curDrive">
<!--- A DriveType of 2 indicates a fixed disk --->
<cfif curDrive.DriveType IS 2>
<cfset driveSpace["#curDrive.DriveLetter#"]=curDrive.availablespace>
<tr><td><cfoutput>
<strong>#curDrive.DriveLetter#:</strong>
Drive has <strong>#ReplaceNoCase(RJustify(trim(NumberFormat(curDrive.availablespace, "999,999,999,999")), 15), " ", " ", "all")#</strong> Bytes free </cfoutput>
</td></tr>
</cfif>
</cfloop>
</table>
That was a straight copy'n'paste from our management system so apologies for the lack of comments, quick and dirty formatting code, etc., :-) A more complete version could show the space taken by a directory, eg by a client's site.
BTW, Peter, as you and I are the oldest CF developers in this part of the world you might appreciate a little history we threw up on the home page of our management system:
http://k2o.mbcomms.net.au/
Tale a peek at the CF bit, I think I have got it right (got frustrated this arvo and knocked it up in a hurry), yell if there is anything I can add......
-- yours,
Kym
--- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
