Reputation: 20845
How do I set the right header if the filename should have a space in the name?
I tried
header( "Content-Disposition: attachment; filename=a fielename with spaces.txt");
but that gives only the suggested fielname "a" and cuts off the rest.
Upvotes: 3
Views: 6972
Reputation: 3621
header( 'Content-Disposition: attachment; filename="a fielename with spaces.txt"');
Upvotes: 4
Reputation: 1084
$file_name = 'a fielename with spaces.txt';
header("Content-disposition: attachment; filename=\"".$file_name."\"");
Upvotes: 22