Save As.. dialog for jpg

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
photobank
-


Joined: 27 Apr 2004
Posts: 9
Location: thailand

PostPosted: Tue Apr 27, 2004 4:32 am    Post subject: Save As.. dialog for jpg Reply with quote

Much appreciate if you could help me to figure out an HTTP header to force a browser into louching the usual "Save as.." dialog rather then open jpg files.
I have read ContenType could work somehow, but I do not know how to do it in practice.
thank you in advance.
_________________
alberto
Back to top View user's profile Send private message Visit poster's website
iNaNimAtE
-


Joined: 05 Nov 2003
Posts: 2381
Location: Everywhere you're not.

PostPosted: Tue Apr 27, 2004 4:34 am    Post subject: Reply with quote

I don't know if that's possible; however I do know a commonly used practice is to put images and other files that won't download into ZIP archives.

Maybe try that.
_________________
Bienvenidos!
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Tue Apr 27, 2004 4:47 pm    Post subject: Re: Save As.. dialog for jpg Reply with quote

photobank,

Try this small PHP script:

Code:

<?
$file = "c:\\images\\img1.jpg";
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".basename($file).";");
header("Content-Length: ".filesize($file));
readfile($file);
?>


The value of $file is the only paramter in this script that will force the download dialog.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Tue Apr 27, 2004 5:33 pm    Post subject: Reply with quote

Aprelium , I thank you for this !

My Anti-leech script is now going public !

Edit: I used your script but the zip file
is named .php when downloaded , weird!
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group