Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2005



Tip: Looking for answers? Try searching our database.

cffile to rename file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
agentcooter@pobox.com - 30 Sep 2005 01:37 GMT
How would one use the cffile tag to dynamically rename any file to
replace spaces with underscores.
Example, user uploads a file called "photo 1.jpg" but I want to change
the space to an underscore, and save the file as photo_1.jpg.
I have the form that uploads OK, I just don't know how to change the
space to an underscore in the filename before saving.  I've looked at
using #replace but can't get it right.
Thanks!
allen@oysterweb.com - 30 Sep 2005 14:29 GMT
I think there are multiple issues trying to rename the file prior to
saving.

I would suggest simply saving the file, then renaming it to the format
you want.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.