Reply
How do I enable visitors to download images?
Old 01-09-2009, 12:29 PM How do I enable visitors to download images?
Burnsie's Avatar
Skilled Talker

Posts: 64
Trades: 0
Hi all
I am attempting to build an image gallery using PHP and mysql. All is going to plan (although very slowly), I have a number of folders that open to show thumbnail pictures. These can then be clicked to show a bigger picture. This all works fine but I would then like to enable visitors to download a yet bigger pictue to use as wallpaper (1024 x 768 pixels). Is this very complicated to perform? If not how is it done? My PHP is very limited as it appears to be the work of the devil so please be gentle with me!

As always cheers in advance
Burnsie
Burnsie is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 01-09-2009, 12:58 PM Re: How do I enable visitors to download images?
chrishirst's Avatar
Super Moderator

Posts: 21,648
Location: Blackpool. UK
Trades: 0
link to it!
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-09-2009, 01:01 PM Re: How do I enable visitors to download images?
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
http://elouai.com/force-download.php
gives quite a nice explanation.

What you want to do is send the file as an attachment, by letting PHP send the headers and then reading the file.

I don't think you require all the filetypes shown in this script, but you might have different image formats and they don't work with the same header.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 01-10-2009, 10:23 PM Re: How do I enable visitors to download images?
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
Another way to do this is to use .htaccess to set the content disposition. The advantage of this is that you're not limited to the max PHP execution time (which may cause you problems with larger files).

A discussion of this method can be found here...

http://www.dynamicdrive.com/forums/a...hp/t-8408.html
__________________
Will Anderson
It's An Anderson | Twitter | Anderson Web Solutions
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 01-12-2009, 12:27 PM Re: How do I enable visitors to download images?
Burnsie's Avatar
Skilled Talker

Posts: 64
Trades: 0
Hi all
Thanks for the input. Sorry I can't upload my part-built gallery at the moment due to 'technical difficulties'.
I had a look at elouai.com and the download button under the little doll appears to do exactly what I was after! However, the instructions for use are far to vauge for my my tiny php knowledge and might as well be written in Greek!
Perhaps this is a step too far and it's back to beatiful html for me.

cheers
Burnsie
Burnsie is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 02:14 AM Re: How do I enable visitors to download images?
anderswc's Avatar
Super Talker

Posts: 132
Name: Will Anderson
Location: Terre Haute, IN
Trades: 0
Burnsie, did you have a look at the .htaccess discussion? It might be a little simpler to implement, though you'll have to have .htaccess file support.
__________________
Will Anderson
It's An Anderson | Twitter | Anderson Web Solutions
anderswc is offline
Reply With Quote
View Public Profile Visit anderswc's homepage!
 
Old 01-15-2009, 11:10 AM Re: How do I enable visitors to download images?
Burnsie's Avatar
Skilled Talker

Posts: 64
Trades: 0
Hi
err yep I read that and that all made even less sense! They go round in circles with no clear given answers. In fact is finishes with a link to http://elouai.com/force-download.php as suggested by Insensus. I only want visitors to be able to download jpg's no video or anything. The jpg's themselves are not that large and I don't think they need commpressing or anything. I have seen this done and I didn't think it would be too difficult but as I say my php is VERY limited so I have nothing really on which to base these beliefs!

cheers
Burnsie is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 07:30 PM Re: How do I enable visitors to download images?
chrishirst's Avatar
Super Moderator

Posts: 21,648
Location: Blackpool. UK
Trades: 0
Just link to them for goodness sake.

IE users can use the "Set as Background" or "Set as Desktop item" from the RC menu once they have opened the image.

The majority of users with other browsers are usually "tech savvy" enough to know how to RC and download.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-16-2009, 09:36 AM Re: How do I enable visitors to download images?
Burnsie's Avatar
Skilled Talker

Posts: 64
Trades: 0
This of course is my problem! I don't know how to link to the larger pictures.

I have a number of folders all containing the medium size pics. These folders contain thumbnail folders, which obviously contain my thumnail pics. The thumbnails when clicked open the medium pics. I then want to allow visitors to download a yet larger picture by clicking a link. The larger pics can reside in their own folder or with the medium sized pics or anywhere else, I don't know what the best structure might be.
Burnsie is offline
Reply With Quote
View Public Profile
 
Old 07-23-2009, 04:27 PM Re: How do I enable visitors to download images?
Novice Talker

Posts: 14
Trades: 0
There are some image gallery scripts that already have the option to enable download automatically
ekolipik is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How do I enable visitors to download images?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.15418 seconds with 13 queries