Jump to content

why wont this upload script work :(


predator12341

Recommended Posts

Hi all the below code works fine in another project but not the one i am doing currently.

the folders have chmod of 777 so no write issues UPLOAD_PATH is set to the right upload path but i just cant think y it aint working everything looks fine.
please help
regards
Mark

sorry forgot to say it looks as if it is not getting the value inside the file input box i pass it yet it knows it is there as if i use the empty function it sees that there is something in there but when i need to use it in the below code it dont work :(

Code Below

$fileName = $_FILES['uploaded']['name'];
$target = UPLOAD_PATH;
$target = $target .'/'. $_FILES['uploaded']['name'];
echo $target;
$ok=1;

if ($fileName =="text/php")
{
echo "No PHP files<br>";
$ok="0";
}

if($ok == "0")
{
echo "Sorry, there was a problem uploading your file.";
}
else
{
move_uploaded_file($_FILES['uploaded']['tmp_name'], $target);
}
Link to comment
https://forums.phpfreaks.com/topic/15686-why-wont-this-upload-script-work/
Share on other sites

here :)
<form method="POST" action="pdfUploader.php">
*** code here that dont get transfered***

<input type="file" name="uploaded" />

*** code here that dont get transfered***

<input type="submit" name="upload" value="upload" />

*** code here that dont get transfered***

</form>

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.