title: Function for download file links with php
body: <p>I want to add some function to download my files that was uploaded some other day. i am not handy with php so i dont know how to add function and generate link for all listed files at time. </p>
  
  <p>here is my php code:-</p>
  
  <pre><code>// Destination folder for downloaded files
  
  $date = date('m.d.y'); 
  mkdir("uploads/" . $date, 0777, true); 
  $upload_folder = 'uploads/' . $date;
  
  // If the browser supports sendAsBinary () can use the array $ _FILES
  if(count($_FILES)&gt;0) { 
      if( move_uploaded_file( $_FILES['upload']['tmp_name'] , $upload_folder.'/'.$_FILES['upload']['name'] ) ) {
          echo 'done';
      }
      exit();
  } else if(isset($_GET['up'])) {
      // If the browser does not support sendAsBinary ()
      if(isset($_GET['base64'])) {
          $content = base64_decode(file_get_contents('php://input'));
      } else {
          $content = file_get_contents('php://input');
      }
  
      $headers = getallheaders();
      $headers = array_change_key_case($headers, CASE_UPPER);
  
      if(file_put_contents($upload_folder.'/'.$headers['UP-FILENAME'], $content)) {
          echo 'done';
      }
      exit();
  }
  </code></pre>