Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

remove spaces from file upload

Explorer ,
Jun 27, 2006 Jun 27, 2006
Is there a way to remove the spaces from a filename when it is uploaded? e.g. when I browse to a file called "My CV.doc" it removes the space between My and CV and then uploads it?

Cheers
TOPICS
Getting started
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 27, 2006 Jun 27, 2006
specify the target filename and use ReplaceNoCase to remove spaces

i.e.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 28, 2006 Jun 28, 2006
i.e.?

was there an example there?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 28, 2006 Jun 28, 2006
Once you have uploaded the file you can then use cffile to rename it!

You take the current file name and use replace() on it!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 28, 2006 Jun 28, 2006
csber3 wrote:
> Is there a way to remove the spaces from a filename when it is uploaded? e.g. when I browse to a file called "My CV.doc" it removes the space between My and CV and then uploads it?
>
> Cheers

NO, you have to do it the other way around. You upload the file, then
rename it with the <cffile action="rename" ...> tag after your <cffile
action="upload" ...> tag.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 28, 2006 Jun 28, 2006
LATEST
Thanks for the help everyone.

i figured out how to do it but when i put it on our clients server there is an issue using the Duplicate command. I think its because the clients server is using Coldfusion 4.5. Is there an alternative to the Duplicate command?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources