This is the story:
I´ve created a getFile.php document that fetches a file and gets som filerelated stuff from the db.
It then make a header with content-type and so on.
So far so good.
Everything is working fine until I release it on the liveserver.
When I click on the link "download file" that links to the getFile.php document it trys to download the .php dokument instead of the file, if I choose to "open the file" it then ask to download the correct-file.
I suspect that the getFile.php (without header) is handled like an "unknown" file on the liveserver.
So, what can I do?
Can it be made som easy server confs. or do someone have a good solution?
Regards
Mikael Hellman
Need help... http headers
Moderator: General Moderators
are you sure it will download the php-source-file?
That would be a major server-side fault.
Probably it's downloading the correct file but the name of the requested page is used as default name.
Do you have a header("Content-Disposition: attachment; filename=TheNameOfThatFile"); in your script?
afaik some browsers are very specific to the order of headers.
That would be a major server-side fault.
Probably it's downloading the correct file but the name of the requested page is used as default name.
Do you have a header("Content-Disposition: attachment; filename=TheNameOfThatFile"); in your script?
afaik some browsers are very specific to the order of headers.