Uploading File Problem in PHP on Drupal

Posted by Nitz on Stack Overflow See other posts from Stack Overflow or by Nitz
Published on 2010-04-23T10:38:21Z Indexed on 2010/04/23 10:43 UTC
Read the original article Hit count: 185

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about php

Related posts about upload