title: Download files from storage in Laravel
body: <p>I can't download files from storage. Firebug console shows </p>
  
  <blockquote>
    <p>FileNotFoundException in File.php line 41: The file
    "C:\xampp\htdocs\ct\storage/30e9734e1f06bf751da5b3289994fb3f/34.pdf"
    does not exist</p>
  </blockquote>
  
  <p>But files are existing in <code>C:\xampp\htdocs\ct\storage\userdata\30e9734e1f06bf751da5b3289994fb3f</code> folder. I think the file path I mentioned in code is not correct. Please help me to solve this issue.</p>
  
  <p><strong>filesystems.php</strong></p>
  
  <pre><code>'root'   =&gt; storage_path('userdata'),
  </code></pre>
  
  <p><strong>DownloadController.php</strong></p>
  
  <pre><code>    public function show(TagambitionRequest $request)
          {
              $details             = User::select('id', 'created_at')-&gt;findOrFail(Auth::user()-&gt;id);
              $encrypt             = md5($details-&gt;id.$details-&gt;created_at);
              $directories         = Storage::files($encrypt);                                             // Listout Files
              foreach($directories as $values)
              {
                  $split_folder_file = explode('/', $values);           //60e4dda43c442fe610bdbd4a0e5c3a12/19.pdf
                  $splitted_file     = end($split_folder_file);         //19.pdf
                  $explode_filename  = explode('.', $splitted_file);    //explode(19.pdf)
                  $explode_name      = $explode_filename[0];            //19
                  $file_extension    = $explode_filename[1];            //pdf
                  if ($file_extension == 'pdf') {
                      $path  = storage_path().'/'.$encrypt.'/'.$splitted_file;
                      return response()-&gt;download($path, $splitted_file, ['Content-Type' =&gt; 'application/pdf']);
                  }
              }
  }
  </code></pre>