title: FileNotFoundException in File.php line 41
body: <p>In laravel i am making an application that uploads a file and the user can download that same file.</p>
  
  <p>But each time i click to download i get this error.
  <a href="https://i.stack.imgur.com/knOWK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/knOWK.jpg" alt="enter image description here"></a></p>
  
  <p>The view code:</p>
  
  <pre><code>&lt;h5&gt;&lt;a href="/download/{{$filesharing-&gt;fileName}}/{{$filesharing-&gt;fileType}}"&gt;Download&lt;/a&gt;&lt;/h5&gt;
  </code></pre>
  
  <p>The route code:</p>
  
  <pre><code>Route::get('/download/{fileName}/{fileType}', 'FilesharingsController@download');
  </code></pre>
  
  <p>The controller code:</p>
  
  <pre><code>public function download($fileName, $fileType){
      $downloadPath = public_path(). '/assests/' . $fileName ;
      $headers =  array(
          'Content-Type: application/octat-stream',
          'Content-Type: application/pdf'
      );
  
      return Response::download($downloadPath, $fileName . '.' . $fileType, $headers);
  }
  </code></pre>
  
  <p>Please not that when i upload a file i remove its extension.
  Example: if i upload <code>'sample.pdf'</code> it is saved as <code>'sample'</code>.</p>
  
  <p>I have no clue what is wrong as the path in the error is the correct path.
  And the file exists in that path. Plz help</p>
  
  <p>The folder Structure:
  <a href="https://i.stack.imgur.com/stjgf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/stjgf.jpg" alt="enter image description here"></a></p>
  
  <p>And the code used to upload the file is:</p>
  
  <pre><code>// Save uploaded file
      if ($this-&gt;request-&gt;hasFile('file') &amp;&amp; $this-&gt;request-&gt;file('file')-&gt;isValid()) {
          $destinationPath = public_path() . '/assests/';
          $fileName = $filesharing-&gt;fileName . '.' . $this-&gt;request-&gt;file('file')-&gt;guessClientExtension();
          $this-&gt;request-&gt;file('file')-&gt;move($destinationPath, $fileName);
      }
  </code></pre>