Page 2 of 2

Posted: Sat Oct 07, 2006 10:42 pm
by s.dot
orrrrrrrr........ use a relative path :idea:

Posted: Sun Oct 08, 2006 9:06 am
by franknu
ok changes made

same result

code

Code: Select all

<?php


 

 


 $uploaddir = realpath ("C://Program Files//EasyPHP1-8//home//townsfinder//biz.pictures//"); 
 $uploadfile = $uploaddir . basename($_FILES['Picture1']['name']);




if(!empty($_FILES['Picture1'])) 
 { 
    var_dump($uploaddir); 
    var_dump($_FILES); 
        var_dump($_FILES['Picture1']['size']); 
    var_dump($_FILES['Picture1']['error']); 
    var_dump($_FILES['Picture1']['type']); 
      }

   if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$_FILES['Picture1']['name'])) 
    
    { 
       echo("File Uploaded"); 
   } 
    
   else 
    
   { 
       echo ("file no uploaded!"); 
	   print_r($_FILES);
	   echo realpath('./'); 
   } 


  

?>
here is my display

Code: Select all

bool(false) array(1) { ["Picture1"]=> array(5) { ["name"]=> string(11) "beer1_l.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(41) "C:/Program Files/EasyPHP1-8\tmp\phpA4.tmp" ["error"]=> int(0) ["size"]=> int(3859) } } int(3859) int(0) string(11) "image/pjpeg" File Uploaded

Posted: Sun Oct 08, 2006 9:41 am
by franknu
made some changes

and now i am displaying something diffrence..

my code

Code: Select all

<?php

 $uploaddir = realpath ("C://Program Files//EasyPHP1-8//home//townsfinder//"); 
 $uploadfile = $uploaddir . basename($_FILES['Picture1']['name']);

if(!empty($_FILES['Picture1'])) 
 { 
    var_dump($uploaddir); 
    var_dump($_FILES); 
    var_dump($_FILES['Picture1']['size']); 
    var_dump($_FILES['Picture1']['error']); 
    var_dump($_FILES['Picture1']['type']); 
      }

   if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$_FILES['Picture1']['name'])) 
    
    { 
       echo("File Uploaded"); 
   } 
    
   else 
    
   { 
       echo ("file no uploaded!"); 
	   print_r($_FILES);
	   echo realpath('./'); 
   } 


  

?>





my display

Code: Select all

string(44) "C:\Program Files\EasyPHP1-8\home\townsfinder" array(1) { ["Picture1"]=> array(5) { ["name"]=> string(11) "beer1_l.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(41) "C:/Program Files/EasyPHP1-8\tmp\phpC0.tmp" ["error"]=> int(0) ["size"]=> int(3859) } } int(3859) int(0) string(11) "image/pjpeg" File Uploaded

Posted: Sun Oct 08, 2006 1:16 pm
by RobertGonzalez
Have you read the manual on what realpath() does?