Here is some sample code:

________________________________________________

$file_name = explode(".", $_FILES['picture']['name']);
                $name = str_replace('', '_', $file_name[0]);
                
                # check if file uploaded is good
                if 
                (
                        !in_array($_FILES['picture']['type'],
$file_type) 
                        || trim($_FILES['picture']['tmp_name']) == "" 
                        || trim($_FILES['picture']['tmp_name']) ==
"none"
                )
                {
                        echo ('You can upload a JPG or JPEG filetype
only.');
                        
                        exit;
                }
                
                # Add slashes to prevent certain errors
                $picture_name = strip_tags($_FILES['picture']['name']);
                $picture_name = addslashes($picture_name);
                $picture_name = str_replace("\r\n", "", $picture_name);
                $picture_name = str_replace(" ", "", $picture_name);

____________________________________________________

-----Original Message-----
From: Richard Whitney [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, January 25, 2003 5:12 PM
To: Victor
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] + in filenames

Some sample code would help, but maybe try urldecode('$filename');

RW

Quoting Victor <[EMAIL PROTECTED]>:

### I have a file upload field, and some filename checking code, but it
### breaks the code whenever a + is inside the filename it verifies
space
### and other tags but breaks on + in the name. Anyone know a fix for
this
### please? 
### 
### - Vic
### 
###
______________________________________________________________________ 
### Post your free ad now! http://personals.yahoo.ca
### 
### -- 
### PHP General Mailing List (http://www.php.net/)
### To unsubscribe, visit: http://www.php.net/unsub.php
### 
### 


-- 
Richard Whitney
Transcend Development
Producing the next phase of your internet presence.
[EMAIL PROTECTED]
http://xend.net
602-971-2791

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

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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

Reply via email to