skip to Main Content

I’m not sure if I am fighting with something impossible in PHP

I was trying to redirect and download or download and redirect, but either doesn’t work.

After the user download the PDF, I want to redirect back to the main page

I’ve tried

header("Location: https://www.main-page.com");
return Response::download($file,"file.pdf", $headers);

Ex

https://www.main-page.com

https://www.main-page.com/pdf (show download PDF and return back to the main page)

2

Answers


  1. In this case you need to implement a pdf reader inside your webpage then you give your user the way to go backward to the main domain.

    Login or Signup to reply.
  2. you can try this

    Response::download($file,"file.pdf", $headers); return redirect("path location you want to redirect");

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search