Jump to content

uploading error message


mstabrey

Recommended Posts

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.