Re: File Upload & spaces in filenames
| From: | Tom Rogers | Date: | Fri, 18 Oct 2002 14:23:12 +0000 |
| Subject: | Re: File Upload & spaces in filenames | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-120508@lists.php.net to get a copy of this message | ||
Hi,
Saturday, October 19, 2002, 12:12:39 AM, you wrote:
ehhc> I have a page where I have someone uploading a file select the file using
ehhc> a simple form and submit the form using multipart form data. Everything
ehhc> works the way it should until someone selects a file that contains a space
ehhc> in the username. What do I need to do to handle this? No-space filenames
ehhc> work just fine.
ehhc> Thanks,
ehhc> Ed
I do this with uploaded files
$file = trim($_FILES["userfile"]["name"]);
if($file != ""):
$file = ereg_replace("'","",$file); //no pesky quotes
$file = ereg_replace("%20","_",$file); //no spaces
$file = ereg_replace(" ","_",$file); //no spaces
.
.
.
.
--
regards,
Tom