Diana,
There are a couple of things you could do; you can use the len() function to
test the length of the uploaded filename and throw an error if it exceeds 20
characters (or simply rename it) You might be able to use JavaScript on the
client to check the filename there, but you might have to parse through
various kinds of paths (ie, Windows uses \, UNIX uses /) to figure out which
part of the field is the filename and which is the directory parth.
Matt
-----Original Message-----
From: Diana Nichols [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 18, 2001 7:07 PM
To: CF-Talk
Subject: filenames
Anyone have an elegant solution to not allowing uploaded filenames to be
more than, say 20 characters?
In other words, before or after a file is uploaded, is there an easy way to
check how long the name is, and truncate it if necessary? or to rename
I can "list" the directory, loop through the names as strings, etc....but am
wondering if there's a faster way.
TIA!
D
*************
Diana Nichols
Webmistress
http://www.lavenderthreads.com
770.434.7374
"One man's magic is another man's engineering." ---Lazarus Long
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists