Uploading File Problem in PHP on Drupal
- by Nitz
I don't know why but i had written clear cut code for uploading file in my page.
i had written like this... on the client side.
<form id="recipeform" onsubmit="return checkAll()" action="submit.php" method="post" class="niceform" enctype="multipart/form-data">
<input name="uploaded" type="file" />
And on submit.php... i am writting like this.....
$target = "newupload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)){
echo "The file ". basename( $_FILES['uploaded']['name']). " has been uploaded";
}
else{
echo "Sorry, there was a problem uploading your file.";
}
simple code but then also i can't able to upload the file..
And i had made my webiste in Drupal.
Thanks in advance.
www.panchjanyacorp.com