Skip to main content
February 20, 2008
Question

CFFILE > RENAME file name length

  • February 20, 2008
  • 2 replies
  • 851 views
What are the limitations on filename for renaming. I have users uploading files will very long names and invalid characters, is there a list of charactersthat will cause problems?

THE POTATO PETE-MPEG4 H264 480 16:9-LONE DRLF TV H.264.mov
This topic has been closed for replies.

2 replies

Inspiring
February 22, 2008
fyi, nameconflict attribute is available only in cffile with action='upload'

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Inspiring
February 22, 2008
I imagine file system path limits and illegal characters are determined by your o/s, not cffile.
Inspiring
February 22, 2008
This should help use the makeunique with the cffile tag also you may have probs with file names that are either reserved or have space in them

http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001617.htm

Resolving conflicting filenames
When you save a file to the server, there is a risk that a file with the same name might already exist. To resolve this problem, assign one of these values to the nameConflict attribute of the cffile tag:

Error (default) ColdFusion stops processing the page and returns an error. The file is not saved.

Skip Allows custom behavior based on file properties. Neither saves the file nor returns an error.

Overwrite Overwrites a file that has the same name as the uploaded file.

MakeUnique Generates a unique filename for the uploaded file. The name is stored in the file object variables serverFile and serverFileName. You can use this variable to record the name used when the file was saved. The unique name might not resemble the attempted name. For more information on file upload status variables, see Evaluating the results of a file upload.