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
https://forums.phpfreaks.com/topic/9768-uploading-error-message/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.