RE: reg exp to filter bad characters in filename
by "jeremy" <jeremy(at)localnetamerica.com>
|
| Date: |
Wed, 5 Jun 2002 11:14:52 -0400 |
| To: |
"'Richard Walker'" <richardwalker(at)onebox.com>, <hwg-languages(at)hwg.org> |
| In-Reply-To: |
onebox |
| |
todo: View
Thread,
Original
|
|
I would also be interested in something like this. Unfortunately, all I
have gotten around to writing is renaming the file in case one with the
same name already exists.
Jeremy Brown
Director of Web Technology
Hafenbrack Marketing and Communications
http://www.hafenbrack.com
(937) 859-0730
-----Original Message-----
From: owner-hwg-languages(at)hwg.org [mailto:owner-hwg-languages(at)hwg.org]
On Behalf Of Richard Walker
Sent: Wednesday, June 05, 2002 10:35 AM
To: hwg-languages(at)hwg.org
Subject: reg exp to filter bad characters in filename
Yo
I wrote a PHP app to allow people to upload files. Immediately the
client
proceeds to upload files with all kinds of gunk in them, such as '+'
and ' '.
I need a reg exp to filter out everything but alphanumeric, ., and _
characters. I could do a nested if statement or something but I know
there's a nice terse Perl compatible solution.
Thanks!
--
Richard Walker
RichardWalker(at)onebox.com - email
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.