> I want to remove unwanted characters from filenames of files uploaded to
> our server. I am currently using strtr to do this. I have a few characters
> that are being removed but I would also like a single quote to be removed
> if it is in the filename. I think it has to be escaped in the command
Ed:
Better yet, because not all browsers pass through the original file name
that was was uploaded, have the user input the name - and validate that
instead. You can then restrict them to numbers letters:
$filename=ereg_replace("[^0-9a-zA-Z.]","",$filename)
Or something like that.
On 5/28/03 1
---
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:49 AM
To: Joe Stump
Subject: RE: [PHP] strtr question
Yes this would be great only I'm not substituting a single character
found in a filename but a host of characters found in filenames.
Ed
On Wed, 28 May 2003
PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 7:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP] strtr question
I want to remove unwanted characters from filenames of files uploaded to
our server. I am currently using strtr to do this. I have a few characters
that are being remov
I want to remove unwanted characters from filenames of files uploaded to
our server. I am currently using strtr to do this. I have a few characters
that are being removed but I would also like a single quote to be removed
if it is in the filename. I think it has to be escaped in the command
though
5 matches
Mail list logo