Re: Can I open an image from HTML direct in a external-program?
- From: "Amos E Wolfe" <amos.wolfe@xxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 00:09:48 GMT
<michelr.be@xxxxxxxxx> wrote in message
news:ee37976b-64cc-4f6f-a4dd-dbc6047f52cf@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How do I write in HTML-code where as one clicks on a displayed jpg,
the assigned computer program opens it instead of the internet-
explorer?
This way (on my PC) "Windows Picture and Fax Viewer" should open the
JPG when clicking on that JPG image dispayed in IE.
So <A> and <IMG> always reloads the *.JPG in the browser. Maybe I need
to use <OBJECT>, but how?
The photo-sharing website "flickr" uses some kind of scripting to force the
"open or save" dialog box to open rather than opening the file in the
browser. I use a php script - the filename is passed to the script in the
url, in this case it is used for .pdf files, so the URL
"http://www.mysite.example/pdf.php/myfile.pdf" would pass the filename
"myfile.pdf" to "pdf.php".
The script passes the file back to the browser as its output which brings up
the dialog box to open or save.
For a working example try this URL (2.14MB .pdf file)
http://www.northantscamra.org.uk/pdf.php/overthebarrel-nov2007.pdf
php script below:
<?php
if ( substr($_SERVER['PATH_INFO'], 1) == "" ) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mysite.example/404.html");
exit();
}
$pdf = substr($_SERVER['PATH_INFO'], 1);
if(preg_match('/^[a-zA-Z0-9_\-]+.pdf$/', $pdf) == 0) { print "Illegal name:
$pdf"; return; } header('Content-type: application/pdf');
header('Content-disposition: Attachment; filename=' . $pdf); readfile($pdf);
?>
Short answer (I don't think it can be done in HTML)
-=# Amos E Wolfe #=-
.
- Follow-Ups:
- Re: Can I open an image from HTML direct in a external-program?
- From: Andy Fish
- Re: Can I open an image from HTML direct in a external-program?
- References:
- Can I open an image from HTML direct in a external-program?
- From: michelr . be
- Can I open an image from HTML direct in a external-program?
- Prev by Date: Re: A record for CSS file size?
- Next by Date: Re: Any Idea for IE and Opera - Its working with Firefox ...
- Previous by thread: Can I open an image from HTML direct in a external-program?
- Next by thread: Re: Can I open an image from HTML direct in a external-program?
- Index(es):
Relevant Pages
|