Jump to content


Photo

uploading error message


  • Please log in to reply
2 replies to this topic

#1 mstabrey

mstabrey
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 16 May 2006 - 08:39 AM

I get the following two lines of errors when trying to upload a file to a server:


Warning: copy(): open_basedir restriction in effect. File(../uploads/Muiz1.JPG) is not within the allowed path(s): (/usr/www/users/pretex:/usr/home/pretex:/tmp:/usr/local/lib/php) in /usr/www/users/pretex/uploader.php on line 4

Warning: copy(../uploads/Muiz1.JPG): failed to open stream: Operation not permitted in /usr/www/users/pretex/uploader.php on line 4
Could not upload file


Here is the php file:

<?php
if( $_FILES['file']['name'] !='')
{
copy ( $_FILES['file']['tmp_name'], "../uploads/" . $_FILES['file']['name'] )
or die ("Could not upload file" );
}
else{ die( "No file specified" );}

?>

<html>
<body><h2>File upload complete</h2>
<ul>
<li>Sent: <?php echo $_FILES['file']['name']; ?>
<li>Size: <?php echo $_FILES['file']['size']; ?> bytes
<li>Type: <?php echo $_FILES['file']['type']; ?>
</ul>
</body>
</html>


Any ideas anyone?

Mart

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 16 May 2006 - 12:30 PM

First things first with all uploads: have you used chmod on the folders in question to change the permissions to 777?

Info: PHP Manual


#3 mstabrey

mstabrey
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 16 May 2006 - 02:02 PM

I have no idea what you're talking about, but I will find out from our hosters.
Thanks!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users