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 10:42 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

> 
> 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. How do I do this?
> 
> TIA,
> 
> Ed
> 
> 

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to