title: Download S3 file links in Laravel
body: <p>I'm trying to build a small application in <code>VueJs</code> as frontend and <code>Laravel</code> as backend where I'm uploading files in my admin section to my <code>aws-s3</code> while uploading the files I'm storing the link of that file in database. Every action is maintained by api calls, now I want to give option of these downloads to my end users so I'm making an axios call something like this:</p>
  
  <pre><code>downloadPDF(docs){
      const documents = {
          document: docs
      }
      axios.post('api/documents-download', documents, {headers: getHeader()}).then(response =&gt; {
          if(response.status === 200)
          {
              console.log('Downloaded')
          }
      })
  },
  </code></pre>
  
  <p>And in my controller I'm having something like this:</p>
  
  <pre><code>public function download(Request $request)
  {
      $headers = [
          'Content-Type' =&gt; 'application/pdf',
          'Content-Description' =&gt; 'File Transfer',
          'Content-Disposition' =&gt; "attachment; filename=filename.pdf",
      ];
  
      return response()-&gt;download($request-&gt;document, 'filename.pdf', $headers);
  }
  </code></pre>
  
  <p>But it is throwing me error:</p>
  
  <blockquote>
    <p>The file "<a href="https://s3-us-west-2.amazonaws.com/noetic-dev/2_Project/shiven-affordable-housing-surat/3_Document/Form+1/Form1.pdf" rel="nofollow noreferrer">https://s3-us-west-2.amazonaws.com/noetic-dev/2_Project/shiven-affordable-housing-surat/3_Document/Form+1/Form1.pdf</a>" does not exist</p>
  </blockquote>
  
  <p>This file clearly exists and made public as you can see above url shows the documents as linked.</p>
  
  <p>Help me out with this. Thanks</p>