title: Download document from sqlite through website
body: <p>I have store a sample document inside my local server named template.doc. Then I store the file directory inside my sqlite table. I manage to call out the path of the file directory but how can I allow the user to download it?</p>
  
  <p>Codes</p>
  
  <pre><code>    &lt;form id="List" name="List" method="post" action=""&gt;
            &lt;select name="List" id="List"&gt;
                         &lt;?php 
              if ($Choice !="No")
              {
                              $path = $_SERVER['DOCUMENT_ROOT']."/WEB/";
                  $fullPath = $path.$_GET['$Choice'];
                                  echo "&lt;form id=\"form7\" name=\"form7\" method=\"post\" action=\"\"&gt;";
                  echo "&lt;input type=\"submit\" name=\"Download\" id=\"Download\" value=".$fullPath."/&gt;";
  
                  if (file_exists($fullPath)) 
                  {
                      header('Content-Description: File Transfer');
                      header('Content-Type: application/octet-stream');
                      header('Content-Disposition: attachment; filename='.basename($fullPath));
                      header('Content-Transfer-Encoding: binary');
                      header('Expires: 0');
                      header('Cache-Control: must-revalidate');
                      header('Pragma: public');
                      header('Content-Length: ' . filesize($fullPath));
                      ob_clean();
                      flush();
                      readfile($fullPath);
                      echo "&lt;label&gt;".$fullPath."&lt;/label&gt;";
                      echo "&lt;input type=\"submit\" name=\"Download\" id=\"Download\" value=".$fullPath."/&gt;";
                      exit;
                                              echo '&lt;/form&gt;';
                  }
              }
              ?&gt;
  </code></pre>
  
  <p>How to create a button below the list form and download the microsoft word? It now flushes out the Microsoft word text on the website now, not on the button.
  Kindly advise if it's possible to do it. Just for local testing. Thanks alot!</p>