There are similar questions, but none helped me, so please help me. I am trying to upload pdf format in a file using php, but it is not uploading. But with the same code word document got uploaded. What's the problem? How to fix it?
<html>
<form action="addbook.php" method="post" enctype="multipart/form-data">
<input name="pdffile" type="file"</div>
<input type="submit" name="myfile">
</form>
</html>
Below code is addbook.php
<?php
$pdf=$_FILES['pdffile'];
$doc=$pdf['name'];
$pdftemp = explode(".", $pdf["name"]);
$newpdfname = round(microtime(true)) . '.' . end($pdftemp);
move_uploaded_file($pdf["tmp_name"], "propic/" . $newpdfname);
?>
I expect pdf file to get uploaded in the file called propic.