Jump to content

Product download - force to open in browser?


Recommended Posts

Hi Everyone,

 

Does anyone know if it's possible to force the browser to open the virtual product instead of offering to save it to the computer?

 

In normal circumstances I would use an htaccess file for this but was wondering if this would work with Prestashop or cause issues?

 

The file type I want to have opened is just a normal PDF.

 

Thank you in advance.

Link to comment
Share on other sites

I am not sure if you can easily do that, as the file that is being linked is a .php file, which in turns does the validation to ensure the customer has the right to access the file.

 

Maybe someone else may have an idea, the only "brute force" solution I can think of (and I'm not sure if it will work) is modifying php to include .pdf as a an extension, then changing the get-file.php file to .pdf which will trick the browser to think it's a pdf file and load it directly.

 

Actually, not that I think about it, you may be able to achieve the same thing using a URL rewrite (of get-file.pdf to get-file.php).

Link to comment
Share on other sites

×
×
  • Create New...