Page 1 of 1

browser won't display save dialog using Content_Disposition

Posted: Fri Nov 28, 2008 2:22 pm
by allasso
Hello,

I have also tried to get the browser to display a save dialog using (again, first thing on the page):

<?php
header('Content-type: text/html');
header('Content-Disposition: attachment; filename="file.html"');
readfile('file.html');
?>

I get no errors, it just doesn't work.

any ideas?

Thanks, Allasso

Re: browser won't display save dialog using Content_Disposition

Posted: Fri Nov 28, 2008 8:36 pm
by requinix
Just because you don't see any errors doesn't mean there are any.

I see two possible reasons why it doesn't work. Put a ini_set("display_errors", 1) before the header() calls and see if you get any messages then.

Re: browser won't display save dialog using Content_Disposition

Posted: Sat Nov 29, 2008 6:09 pm
by allasso
thanks much, I'll try that.

Re: browser won't display save dialog using Content_Disposition

Posted: Sun Nov 30, 2008 4:05 pm
by allasso
seems to work now. Inexperience the problem no doubt.

Thanks much.

Allasso