Uploader script problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
antland01
Forum Newbie
Posts: 2
Joined: Tue Mar 17, 2009 1:32 am
Location: Auckland New Zealand

Uploader script problems

Post by antland01 »

I have modified a php uploader script from about.com http://php.about.com/od/advancedphp/ss/ ... load_5.htmto be able to do choose which folder in which it goes to the folder is specified using a drop down list in the html form but for some reason it keeps returning the error
Warning: move_uploaded_file(/libxml2.dll) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/ant/antland_html/Homeworkuploader/upload.php on line 30
and
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpgDIBgy' to '/libxml2.dll' in /home/ant/antland_html/Homeworkuploader/upload.php on line 30
Sorry, there was a problem uploading your file.
i have tryed everything i know to try and get this to work i have no idea what i am doing wrong

Code: Select all

<?php
[b]$subjects=$_POST['SUBJECTS'];[/b]
$target = "[b]$subjects[/b]/"; 
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
 
//This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
 
//This is our limit file type condition
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}
 
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
 
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
 
the code in which i have added has been put in bold any help would be appreciated it probally is something small :D
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Uploader script problems

Post by susrisha »

Code: Select all

 
Permission denied
 
That means the folder permissions are not set .. Please check the folder permissions of the folder and try again
User avatar
antland01
Forum Newbie
Posts: 2
Joined: Tue Mar 17, 2009 1:32 am
Location: Auckland New Zealand

Re: Uploader script problems

Post by antland01 »

I have checked the folder permissions for all of the folders involved and it is set to being read and write and also if this helps the varible subjects reffers to the drop down box it which i have on the forum that specifys which folder it is to go into
Post Reply