My code generates a PDF and saves to a server. the user can access a view the PDF however i wish to incorporate a save function. I have see that adding the document to the header will work, however generated code is in a separate php file and doesn't trigger a download.
header('Content-Disposition: attachment; filename="file.pdf"')