Re: image upload problem
| From: | Jo�o C�ndido de Souza Neto | Date: | Thu, 29 Jun 2006 12:10:12 +0000 |
| Subject: | Re: image upload problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238905@lists.php.net to get a copy of this message | ||
Please, check that:
http://br.php.net/manual/pt_BR/function.move-uploaded-file.php
"suresh kumar" <asureshkumar_1983@yahoo.co.in> escreveu na mensagem
news:20060629120141.30388.qmail@web8601.mail.in.yahoo.com...
> Hi,
> This is the code i am using for image upload.
> if ($_FILES['ufile']['name'] != NULL)
> {
>
> $FlName= $_FILES['ufile']['name'];
> if(!is_uploaded_file($_FILES['ufile']['tmp_name'])){
>
> print "<Script type=\"text/javascript\">
> alert(\"Error! The expected file wasn't loaded\");
>
> </script>";
>
> exit();
> }
>
> $uploadfile = $_FILES['ufile']['tmp_name'];
> $uploadname = $_FILES['ufile']['name'];
> $uploadtype = $_FILES['ufile']['type'];
> $tempfile = fopen($uploadfile, 'rb');
>
> $filedata = addslashes(fread($tempfile,filesize($uploadfile)));
> $UpdateAdQuery = "update ". $thisAdTableName." set
> LocalImageName='" . $PostLocalCopy . "',
> ImageData='" . $filedata . "',
> ImageName='" . time() . "_".$uploadname ."',
> mimetype ='" . $uploadtype . "'
> where ID=" . $mID ;
> $ok = @mysql_query($UpdateAdQuery);
> }
>
> The Code is running properly.But I dont Know Where The uploaded image is
> Stored in the server.I checked "/tmp" directory,but image is not there,is
> there any function where i can specify the location of the server where my
> image is to be stored i also tired move_uploaded_image() function .but its
> not working .I am waiting reply from any one
>
>
> ---------------------------------
> Yahoo! India Answers: Share what you know. Learn something new Click here
> Catch all the FIFA World Cup 2006 action on Yahoo! India Click here