sshare Posted December 17, 2012 Share Posted December 17, 2012 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 More sharing options...
tomerg3 Posted December 17, 2012 Share Posted December 17, 2012 What's the point? They will still be able to save the PDF if they open it in their computer, why make it harder? Link to comment Share on other sites More sharing options...
sshare Posted December 18, 2012 Author Share Posted December 18, 2012 The point is to (try to) make it harder on them, the PDF that will be opened is only printable. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 18, 2012 Share Posted December 18, 2012 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 More sharing options...
sshare Posted December 18, 2012 Author Share Posted December 18, 2012 Thanks for the input tomerg3, could you point me in the right direction to trying the URL rewrite to see if it will work? Link to comment Share on other sites More sharing options...
tomerg3 Posted December 18, 2012 Share Posted December 18, 2012 It will need to go in your htaccess file. (a rewrite rule that will change the .pdf file to .php) I don't have an example off the top of my head, you may need to research URL rewrite a bit, Link to comment Share on other sites More sharing options...
Recommended Posts