Horje
how to upload pdf file using php Code Example
how to upload pdf file using php
//Form 
<form method="post" action="db_connect.php" role="form" enctype="multipart/form-data"> 
	<input type="file" name="pdf_file" id="pdf_file" accept="application/pdf" />
	<button id="send" type="submit" name="submit" class="btn btn-success">Submit</button>
</form>
//create a file db_connect.php
/// create connection to your database using your localhost server, username, password
 // the name of your database

<?php

$allowedExts = array("pdf");
$temp = explode(".", $_FILES["pdf_file"]["name"]);
$extension = end($temp);
$upload_pdf=$_FILES["pdf_file"]["name"];
move_uploaded_file($_FILES["pdf_file"]["tmp_name"],"uploads/pdf/" . $_FILES["pdf_file"]["name"]);
$sql=mysqli_query($con,"INSERT INTO `Table Name`(`pdf_file`)VALUES($upload_pdf')");
if($sql){
	echo "Data Submit Successful";
}
else{
	echo "Data Submit Error!!";
}
?>




Php

Related
Please provide a valid cache path. Code Example Please provide a valid cache path. Code Example
php remove bom Code Example php remove bom Code Example
php auto scoll page with output Code Example php auto scoll page with output Code Example
laravel flutter save image in data Code Example laravel flutter save image in data Code Example
How to write a loop in PHP Code Example How to write a loop in PHP Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8