Content-Disposition ERR_INVALID_RESPONSE response

Modified on Thu, 14 Oct 2021 at 07:40 PM

When you send out a Content-Disposition header in PHP, you might end up in some situations with the wrong HTTP status code. Simply adding ",true, 200" as arguments to the header function resolves this issue.

header('Content-Disposition: attachment; filename="'.$filename.'.csv";', true, 200);

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article