As explained by Alex’s link you’re probably missing the header Content-Disposition
on top of Content-Type
.
So something like this:
Content-Disposition: attachment; filename="MyFileName.ext"
Related Contents:
- Create a CSV File for a user in PHP
- Is header(‘Content-Type:text/plain’); necessary at all?
- Utility of HTTP header “Content-Type: application/force-download” for mobile?
- How do I find the MIME type of a file with PHP?
- Why would one omit the close tag?
- Download File to server from URL
- How to set HTTP header to UTF-8 using PHP which is valid in W3C validator
- How do I read any request header in PHP
- Getting HTTP code in PHP using curl
- Easy way to test a URL for 404 in PHP?
- Removing X-Powered-By
- HTTP authentication logout via PHP
- How to prevent Browser cache for php site
- How to force file download with PHP
- PHP file_get_contents() and setting request headers
- How to make PDF file downloadable in HTML link?
- How to use the CSV MIME-type?
- Resumable downloads when using PHP to send the file?
- Downloading a large file using curl
- How do I track file downloads
- How to send 500 Internal Server Error error from a PHP script
- Check if PHP-page is accessed from an iOS device
- How to prevent my site page to be loaded via 3rd party site frame of iFrame
- Handling PUT/DELETE arguments in PHP
- phpexcel to download
- Return a PHP page as an image
- New lines (\r\n) are not working in email body
- Does $_SERVER[‘HTTP_X_REQUESTED_WITH’] exist in PHP or not?
- Force file download with php using header()
- Forcing to download a file using PHP
- Streaming a large file using PHP
- Symfony2 – Force file download
- apache directory listing, download all
- How to remove HTTP headers from CURL response?
- How to properly use Bearer tokens?
- Get “Content-Type” header of request in PHP
- Show image using file_get_contents
- Use Laravel to Download table as CSV
- How to Automatically Start a Download in PHP?
- Check file uploaded is in csv format
- Create a text file for download on-the-fly
- Hiding PHP’s X-Powered-By header
- Fetching custom Authorization header from incoming PHP request
- How can I set a cookie and then redirect in PHP?
- Request headers bag is missing Authorization header in Symfony 2?
- Calling closure assigned to object property directly
- Checking if ANY of an array’s elements are in another array
- How can I use “Dependency Injection” in simple php functions, and should I bother?
- Why is base64_encode() adding a slash “/” in the result?
- Hashing an entire PHP array into a unique value [duplicate]