I'm not sure you can. It's acrobat reader that opens it inside your browser as a kind of a plug-in for it, so I'm not sure if you can get it to open in the seperate window.
<?
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>
it cant be done in HTML, you have to do it through a php script
eg
here is the php script lets call in plop.php
PHP:<? $file = $_GET['file']; header ("Content-type: octet/stream"); header ("Content-disposition: attachment; filename=".$file.";"); header("Content-Length: ".filesize($file)); readfile($file); exit; ?>
and then you call it by
<a href="plop.php?file=picture.jpg">Download JPG image</a>
Ok, considering i'm a complete novice at this, where would I place this? I have dreamweaver, can I place it within the body of the code in dreamweaver?
no, you put the php code in a text file, save it as plop.php then upload that to your web server and place the html code on any web page you want a download from
be sure to adjust the path of the href to match where you put the php file, and the path of the picture/pdf/other to match its location
Say you wanted to open a file called newwindow.pdf. You could put html on your page like this: <a href="plop.php?file=newwindow.pdf">New Window PDF</a><a href="plop.php?file=picture.jpg">Download JPG image</a>
Your webserver needs to support php for this to work.
The code you put on your html is like this:
Say you wanted to open a file called newwindow.pdf. You could put html on your page like this: <a href="plop.php?file=newwindow.pdf">New Window PDF</a>
Just replace the text with an image instead.
<a href="plop.php?file=newwindow.pdf"><img border=0 src="imagelink.jpg"></a>