با سلام من یک سایت کتابخانه طراحی کردم که کاربر می تونه یک فایل pdf اپلود کنه

کتابخانه انلای&#16.jpg

با توجه به عکسی که گذاشتم تمام اطلاعات در دیتابیس ذخیره میشود به جز فایل pdf چه طور فایل pdf در دیتابیس یا روی هارد ذخیره شود
این کد




<?php
session_start();
require('config/config.php');
mysql_query("set names 'UTF8'");
$query="select * from ketab where name='".$_POST['name']."'";
$result=mysql_query($query);
if ((mysql_num_rows($result))>0)
{
header('location:upload.php?msg=1');
}
if (( strlen($_POST['name'])==0) || (strlen($_POST['subject'])==0) ||(strlen($_POST['author'])==0)||(strlen($_POST['publisher'])==0)||(strlen($_POST['detail'])==0))



{
header('location:upload.php?msg0=1');
}

if(($_POST['name'] == '')|| ($_POST['subject'] == '')||($_POST['author'] == '')||($_POST['publisher'] == '')||($_POST['detail'] == ''))

{
echo ' تمام فیلد ها کامل شود';
}
else {


$query="insert into ketab (name,subject ,author, publisher,detail)values('".$_POST['name']."','".$_POST['subject']."','".$_POST['author']."','".$_POST['publisher']."','".$_POST['detail']."')";
mysql_query($query) or die(mysql_error());
mysql_close($connect);

$_SESSION['name']=$_POST['name'];
$_SESSION['subject']=$_POST['subject'];
$_SESSION['author']=$_POST['author'];
$_SESSION[' publisher']=$_POST[' publisher'];

$_SESSION['detail']=$_POST['detail'];

@$file = $_FILE['FileName'];
$isEx = new SplFileInfo($file);
$ext = array('pdf' => 'pdf' ,'txt' => 'txt');
$rEx = $isEx->getExtension();
@$fSize = $_FILE['FileName']['size'];

if( isset( $ext[$rEx] ) == $rEx && $fSize < 20768 )
{
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/".$_FILES["file"]["name"]);
echo 'کتاب شما پس از بررسی توسط مدیر سایت، به نمایش خواهد آمد';
}
else {
echo 'Could not uploading file';
}






header('location:complete1.php');

}



?>