Prompt to a JPG

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
powerPT
Forum Newbie
Posts: 14
Joined: Tue Apr 04, 2006 2:25 pm
Location: Portugal

Prompt to a JPG

Post by powerPT »

HI!

Can someone else tell me how: Click on a link in text, url is a jpg file and appears a prompt to download?
The usually is the jpg opens a browser window but I don´t want this.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

I don't understand you???

But maybe that is what you wanted:

Code: Select all

<a href="page1.html" title=""><img src="img.jpg" alt="my_pic"></a>
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Usually just these two headers will suffice.

Code: Select all

header('Content-Diposition: attachment; filename=myfile.jpg');
header('Content-Type: image/jpeg');
Post Reply