Jump to content

Archived

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

mstabrey

uploading error message

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

Share this post


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

Share this post


Link to post
Share on other sites
I have no idea what you're talking about, but I will find out from our hosters.
Thanks!

Share this post


Link to post
Share on other sites

×

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.