Vrs. 54.0 - Problem with PHP "readfile" statement

Discussion of bugs in Mozilla Firefox
Post Reply
r.riccardo
Posts: 4
Joined: June 27th, 2017, 12:11 am

Vrs. 54.0 - Problem with PHP "readfile" statement

Post by r.riccardo »

Good morning,
I noticed a problem with the new version 54.0 of firefox.
On some of my websites, to download the file, do the following instructions:

Code: Select all

Javascript:

Function attachment (id)
{
  filename = "./php/dwn_all.php? id =" + id;
  size = "width = 0, height = 0, scrollbars = yes";
  Var win = window.open (filename, "", size);
 }

PHP:
....
...
$String = "../configured/allegato.PDF";
Header ('Content-Description: File Transfer');
Header ("Content-Type: application / octet-stream");
Header ("Content-Disposition: attachment; filename = attachment.PDF");
Header ('Expires: 0');
Header ("Cache-Control: must-revalidate, post-check = 0, pre-check = 0");
Header ('Pragma: public');
Header ("Content-Type: application / force-download");
Header ("Content-Length:". Filesize($string));

readfile ($string);
...
...
In the previous version of firefox I never had any problems, now when I run the firefox statement it closes!
On Chrome and IE no problem, the files are opened / downloaded without any problems.

I have also verified that the problem is not just about my PC, but also about all of my clients who have updated to the new version.

I tried in the forum but I did not find anyone with my usual problem .... what's wrong?

Thank you
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Vrs. 54.0 - Problem with PHP "readfile" statement

Post by therube »

Anything related noted in the Error Console (Ctrl+Shift+J)?
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
r.riccardo
Posts: 4
Joined: June 27th, 2017, 12:11 am

Re: Vrs. 54.0 - Problem with PHP "readfile" statement

Post by r.riccardo »

No warning in logs.

Continuing with the tests we could see that the problem does not occur on all the PCs on which the new version is installed, but we still have not been able to understand what the difference of settings is between one system and another.
At the moment are all pc with Windows 10 and Windows 7 operating system.

The same problem also occurs on a ministerial site of the Italian revenue agency, but I can not give you the link because it is only possible to access through credentials.
So I'm looking for a public site to give you an example where the same problem occurs.

On my side I have been able to verify that the problem occurs both by downloading files with PDF extensions and XML
r.riccardo
Posts: 4
Joined: June 27th, 2017, 12:11 am

Re: Vrs. 54.0 - Problem with PHP "readfile" statement

Post by r.riccardo »

I run Firefox in Safe mode and the problem does not appear.
I then restored Firefox and now the problem is gone.

I'm confused .... now i need to restore Firefox to all my clients? ....
User avatar
Alice0775
Posts: 2818
Joined: October 26th, 2007, 11:25 pm
Location: OSAKA

Re: Vrs. 54.0 - Problem with PHP "readfile" statement

Post by Alice0775 »

I guess ver 54.0.1 fixes this
r.riccardo
Posts: 4
Joined: June 27th, 2017, 12:11 am

Re: Vrs. 54.0 - Problem with PHP "readfile" statement

Post by r.riccardo »

I confirm that with the new version the problem has been resolved.

Thank you
Post Reply