dimanche 18 août 2019

Laravel File not exist, but it do exist

I've got this in my app:

public function redownload(Request $request)
    {
      $invoice_no = $request->get('invoice_no');
      $invoice = Invoice::where('invoice_no',$invoice_no)->first();

      $download_path = ( storage_path() . '/invoice/' . $invoice->pdf_name );
      return( Response::download( $download_path ) );
    }

The URL is valid - I can paste it into a browser and have the file download without any problem.

But, if I try to send the user to that file using Response::download, I get an error.

The file is definitely there and, as mentioned above, can be downloaded if the URL is pasted directly into a browser.

Any ideas why?

Thanks



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2THTVK5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire