I used the following code to upload the pdf file.

session_start();
 ?>

 
 if(array_key_exists('insert',$_POST))
 {  
            include("config.php");

            $frmt_code=$_POST[frmt_code];
            $frmt_des=$_POST[frmt_des];
            $version_no=$_POST[version_no];
            $version_date=$_POST[version_date]; 
            $Dept_Name=$_POST[Dept_Name]; 
            $pdf_file=$_POST[pdf_file]; 
            $sql="INSERT INTO format_master (frmt_code,frmt_des,version_no,version_date,Dept_Name,pdf_file)VALUES('$frmt_code','$frmt_des','$version_no','$version_date','$Dept_Name','".$_FILES['pdf_file']['name']."')";


  $path= "pdf/".$HTTP_POST_FILES['pdf_file']['name'];

  if($pdf_file !=none)
  {
  if(copy($HTTP_POST_FILES['pdf_file']['tmp_name'], $path))
  {

  }
  else
  {
  echo "Error";
  }
  }
  $result=mysql_query($sql) or die(mysql_error());
            if ($result)
            {
                header('Location:    http://localhost/EMP/frmtview.php');
                exit;
                }


  }
  ?>

 
   
   
   

 
 
 
 

 
 
 
 

 
 
 
 

 
 
 
 
 

 
 
 
 
   

 
 
 
 
 


   
     
                
   
   
 
   
 
   
 
 
:
Deportment  Name:
File Name:   
 
       
   
   
   
   
   
   

Using this code file uploaded to the folder & the file name has stored in mysql database in row "pdf_file". I need to replace the file in edit page and want the path in view page. Is anybody can help me?