I am working on an intranet enhancement that will allow the user to open the latest instance(most recently modified or created) of a file within a given directory.
Unfortunately, the cfdirectory
tag (and a few others) are blocked by the hosting provider. I essentially need to mimic the functionality of this piece of code without using cfdirectory
:
<cfdirectory action="list" directory="\\SERVERABC\FILEDIR" name="myDirectory">
<cfloop query="mydirectory">
<cfoutput>
<cfif mydirectory.dateLastModified EQ DateFormat(Now(),'mm/dd/yy')>
<!--- ..display link to file for user to download --->
</cfif>
</cfoutput>
</cfloop>
The FileExists()
function is available. But the default ColdFusion user would not have access to all the network locations that might be available to the actual user within the application itself.
You need to ask your host to give you a security sandbox so you can use those tags. The only reason they couldn't do this is if they are running the CF Standard Edition, and not Enterprise. If that is the case, case you are out of luck as all file i/o tags will be unavailable. No professional CF host runs the Standard Edition.