Hi,

Wednesday, July 30, 2003, 12:09:44 AM, you wrote:
AM> The version is PHP Version 4.2.3.

AM> On Tue, 29 Jul 2003, Tom Rogers wrote:

Then you can use the $_FILES array like this:

if($_FILES["photo"]["error"]==0){   //make sure no errors on upload
    if(!empty($_FILES["photo"]["name"])){   //do we have a file name
        $tempname = $_FILES["photo"]["tmp_name"]; //this is how php has it
        $file = trim($_FILES["photo"]["name"]); //this is what it was called
        //clean up the file name
        //we don't want something like "this is mac's image.jpg"
        $file = ereg_replace("'","",$file);
        $file = ereg_replace("%20","_",$file);
        $file = ereg_replace(" ","_",$file);
        $path = '/home/vencel/www/images/apt';  //this is where we want to store
        //make sure that apt has permissions set to 777 so web user
        //can write to it
        move_uploaded_file($tempname,$file);
    }
}

-- 
regards,
Tom


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

Reply via email to