RE: [PHP] upload problem, urgent plz guy

2003-05-29 Thread Jay Blanchard
[snip]
i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession
on folder:
 
Warning: open_basedir restriction in effect. File is in wrong directory
in /var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
[/snip]

Have you read and tried
http://us4.php.net/manual/en/features.file-upload.php ? 

HTH!

Jay

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



Re: [PHP] upload problem, urgent plz guy

2003-05-29 Thread Marek Kilimajer
Use move_uploaded_file() instead of copy()

fr r wrote:

i'm trying to do a very simple thing:
upload image but it keep giving me this error although i gave permession on folder:
Warning: open_basedir restriction in effect. File is in wrong directory in /var/www/vhosts/negoumelshasha.com/httpdocs/test4.php on line 9
and here is my code:
//
HTMLBODY BGCOLOR=FF 
   ?php 
  $uploadDir = $DOCUMENT_ROOT . /test/;
   if (isset($submit))
 { 
   if ($upload != 'none')
  { 
   $dest = $uploadDir . $upload_name; 
   if (copy($upload, $dest))
   { 
   echo Successfully uploaded $destBR\n; 
   } 
   else
   { 
   echo FONT COLOR=FFBFile Upload Failed/B/FONTBR\n; 
   $perms = @fileperms($uploadDir); 
   $owner = @fileowner($uploadDir); 
   if (!$perms)
{ 
   echo Directory does not exist: $uploadDirBR\n; 
   } 
   else
{ 
   $myuid = getmyuid(); 
   if (!($perms  2)  !(($owner == $myuid)  ($perms  128)))
 { 
   echo get_current_user(),  doesn't have permission to write in $uploadDirBR\n; 
   } 
   } 
   } 
   } 
   else
  { 
   echo FONT COLOR=FFBFile2 Upload Failed/B/FONTBR\n; 
   echo Filesize exceeds limit in FORM or php.iniBR\n; 
   } 
   } 
   ? 
   FORM ENCTYPE=multipart/form-data ACTION=test4.php METHOD=POST 
   INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=1 
   Upload File: INPUT NAME=upload TYPE=FILEBR 
   INPUT TYPE=SUBMIT NAME=submit VALUE=Upload 
   /FORM 
/BODY/HTML 

-
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).
 



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