Allowing user to choose action with a download file

Gudday all
(I am sure that this has been answered so many times but cannot directly find it.)
My wife wishes to have on her site a button on the left hand navigation bar that will be called free pattern’'.
That button should pop up with a screen allowing the user to either a) view the file or b) save it.

I can force the download into the’ downloads’’ folder of their PC without any trouble but not get the option. Trawling through the site has seen such threads and all claim that their post will do it but have not found one that will actually do so. All force the download.
My latest minimal attempt lives at http://www.petalsandpatches.com/testdownloadpattern-4.php
Ignore the label on the button [it should read ‘‘free pattern’’ but I mislabbelled it].

The button calls a file called idolatry.php shown below

<?php
header("Content-disposition: attachment; filename=idolatry.pdf");
header("Content-type: application/pdf");
readfile("idolatry.pdf");
?>

The page code is


<form method="post" action="idolatry.php">
	<input type="image" src="buttons/crystal buttons/JoomlaButtonbuynow.png" />
	<input type="hidden" name="return" value="www.petalsandpatches.com/_<return page>_.php" />
</form>

I must be doing something wrong that is very basic but I cannot see it.

Thanking you in anticipation

Tigers!

Change Content-disposition: attachment to Content-disposition: inline

Lemon Juice
Thank you.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.