Is there a way to programatically save pdf invoices to a directory on the magento server without the system attempting to download it?
I currently use the below code to generate and save the file to a directory on the server but it also attempts to download it. I just need the link which I already get as output but want to prevent the auto downloading it.
Instead of using the fileFactory, I was able to use php's file_put_contents function to create the file in the desired directory. These function requires two input, the first being the file path and the second being the content. Replacing the fileFactory, final script looked like below;