Jump to content

Download link not working, browser opens file as text


Recommended Posts

I have been the whole day searching for a solution of the following problem:

 

I have a store using Prestashop 1.5.2.0 with 2 languages and offer virtual products, some of my customers have complained about being unable to download the files because the browsers tried to open the files as text instead of downloading.

I tried by myself and have noticed that:

- If I use the same browser I use for administrate the shop it works fine ( Chrome)

- If I copy the link into another browser or even Chrome as incognite it doesn't works and browser displays content as text

 

After many hours I deducted the problems was in the cookies, the only sentence on the file Getfilecontroller.php related with cookies is Tools::setCookieLanguage(); I have commented the file and all started to work as expected.

 

Looking at the code for Tools::setCookieLanguage(); I can't see anything that may change the browser behaviour for not downloading the file but in some way it must change the headers.

 

Please, can someone tell me why this happens and if it's safe to just comment this sentence ?

Link to comment
Share on other sites

×
×
  • Create New...