为什么文件内容会丢失,我已经上传,现在尝试下载相同的内容?

I am uploading .docx and .txt files from a html form. files are getting uploaded into specified folder. Then I saved path of that folder to the database. Now then I fetched all the records from database into tabular format.I got a column link in which I am got link to the file i uploaded previously but now when i click that link my file is getting download but not its contents. I am storing file path to database as

$link='<a href="'.$target_dir.'">'.basename($_FILES["file"]["name"]).'</a>'; // Hyperlink to file.

Is this wrong?

I am using table row as

<td>".'<a href="download.php? filename='.$name.'"> Download</a>'."</td>

here $name is $name=$row['filename'];

Can anyone help? here is my php file where i'm fetching records from database

`To Download Resume Click on the link :

  include ('./config.php');
  global $conn; // Create connection
     $query="select * from candidate_regi";
     $result = $conn->query($query);
    echo "<table border='1' cellspacing='3' align='centre' width='70%'>
                <tr align='centre'>
                <th>CANDIDATE_ID</th>
                <th>FULL_NAME</th>
                <th>ADDRESS</th>
                <th>CONTACT</th>
                <th>QUALIFICATION</th>
                <th>EMAIL-ID</th>
                <th>RESUME_NAME</th>
                <th>RESUME_PATH</th>

                </tr>";
             while($row = mysqli_fetch_array($result)){
                 $name=$row['filename'];
                 $type=$row['filepath'];
             echo "<tr ALIGN='CENTER'>
                   <td>".$row['candidate_id']."</td>
                   <td>".$row['full_name']."</td>
                   <td>".$row['address']."</td>
                   <td>".$row['contact']."</td>
                   <td>".$row['qualification']."</td>
                   <td>".$row['email']."</td>
                   <td>".$row['filename']."</td>
                   <td>".'<a href="dw1.php?filename=' . $name . '">download</a>'."</td>

                   </tr>";
             }
              echo "</table>";  }?>