RE: [PHP] + in filenames

From: Date: Sat, 25 Jan 2003 22:26:36 +0000
Subject: RE: [PHP] + in filenames
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-133136@lists.php.net to get a copy of this message
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:rw@xend.net] Sent: Saturday, January 25, 2003 5:12 PM To: Victor Cc: php-general@lists.php.net Subject: Re: [PHP] + in filenames Some sample code would help, but maybe try urldecode('$filename'); RW Quoting Victor <victor@argilent.com>: ### 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. rw@xend.net 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

« previous php.general (#133136) next »