Change File Upload Temp Location

Hello,

I have a simple file upload page that makes use of a standard HTML <input type="file"> tag.  My server script moves the uploaded file to a new location.

Currently the temp file gets uploaded to C:\CFusionMX\runtime\servers\default\SERVER-INF\temp\wwwroot-tmp\ directory, but my C drive is getting low on disk space and depending on the size of the uploaded file it can fail.  Is it possible to change this temp upload directory to another location (particularly onto another disk with more space)?

Thanks in advance for your reply.
ServicePointUSAAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

73SpyderCommented:
I would use cffile to do this.

Below is a link to detailed information on cffile.  http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/manageFiles3.htm
0
ServicePointUSAAuthor Commented:
Thanks.  I already use cffile to move the file once it is uploaded.  I am wondering if there is a way to change the temp directory where the file is initially uploaded.
0
73SpyderCommented:
<cffile action="upload"
    destination="c:\temp\"
    nameConflict="overwrite"
    fileField="Form.FiletoUpload">


you should be able to change the destination as part of the cffile tag as shown above.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

JeffHowdenCommented:
73Spyder, you're not reading the question fully.  The OP knows how to use the <cffile> tag.  The issue is that between the point when the server receives the uploaded file and when the <cffile> tag is usesd to "upload" the file, that file must go somewhere temporarily.  That temporary location is buried deep under the CF install directory.  Unfortunately, I have been unable to find a way to change the location of the temp directory.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
73SpyderCommented:
Jeff you are correct.  I missed that completely.

You could create a batch file that you could schedule to run daily/weekly or however often that would delete the items out of that folder.  This would not move the location of the temp folder, but it would keep it cleaned out for you.

The only other approach I can think of would be to re-build the server with the CF install on a much larger disk to start with.

0
ServicePointUSAAuthor Commented:
Hi Jeff and 73 Spyder.  Your answer is what I was afraid of...doesn't look like there is an easy way to change the temp location.

Thanks for the help...I'll look at alternatives.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.