Link to home
Start Free TrialLog in
Avatar of at999
at999

asked on

coldfusion website - manage temporary files

My coldfusion website generates temporary files(files with exension .tmp) for some images

What is the ideal way to clean these files, how should be the temporary files managed in such websites? thanks....
ASKER CERTIFIED SOLUTION
Avatar of duncancumming
duncancumming
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgrafx
Under what circumstances are these tmp files created?
During file upload?
Could you explain a bit more - for ex. was the creation of these tmp files written on purpose by someone?
Are they under the website directory or are they in the windows ColdFusion temp directory?
(no points please)

Some processes in CF may create temporary files. For example file uploading, charting, etc... But CF typically those files itself, automatically  So as mentioned, please clarify whether you are talking about those types of files ... or some other temporary files _you_ create explicitly within your application code.
>> But CF typically those files itself, automatically

Correction: ... typically REMOVES those files ... automatically
Avatar of at999
at999

ASKER

thanks ......... actually the files gets generated by a coldfusion code - i call coldfusion function GetTempFile()
something like this
<cfset mytempFile = GetTempFile(Application.TempDir,"A1")>

what is the ideal way to clean such files... thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of at999

ASKER

sorry dgrafx, i forgot to mention that these tmp files  are created to create image files from oracle blob tables
yeah - ok
just use the code i posted
it will work

good luck
Avatar of at999

ASKER

thanks a lot to all for your help...   i will create a coldfusion schedule task to delete the temporary files - ussign cf command - fileDelete(Application.tempDir & files.name)
Avatar of at999

ASKER

thanks to all of you for the help
>> i forgot to mention that these tmp files  are created to create image files from oracle blob tables

Just wondering ... but is there a reason you need to do this? In many cases it's not necessary to have physical files since a lot of cf tags work with blobs as well.