Log In · Register

 
Making an image downloadable
miiszxclassiic
post Jul 14 2007, 11:44 PM
Post #1


Senior Member
***

Group: Member
Posts: 50
Joined: Jul 2007
Member No: 541,260



Anyone know a code for making an image (or text) downloadable when you click it? Not a zip file ...just a regular download that saves to the computer
 
 
Start new topic
Replies (1 - 8)
*SinfullySweet*
post Jul 15 2007, 12:42 AM
Post #2





Guest






Upload your file to any number of file hosting sites, and just copy the and paste the downloadable link. I hate zip files too wink.gif
 
lovescream
post Jul 15 2007, 01:00 AM
Post #3


define our lives for us.
********

Group: Staff Alumni
Posts: 11,656
Joined: Aug 2004
Member No: 43,293



Well usually if it's on a hosting site or anything, it'd still be an image. mellow.gif I don't know what'd work, but just tell them to simply right click and save as. >_>
 
*tripvertigo*
post Jul 15 2007, 02:12 PM
Post #4





Guest






no, just LINK the image, in an anchor tag (<a href="http://yoursite.com/yourimage.jpg">download image </a>)
 
dannyordinary
post Jul 15 2007, 03:07 PM
Post #5


Senior Member
******

Group: Member
Posts: 1,011
Joined: Jun 2007
Member No: 533,410



QUOTE(tripvertigo @ Jul 15 2007, 03:12 PM) *
no, just LINK the image, in an anchor tag (<a href="http://yoursite.com/yourimage.jpg">download image </a>)


yep, that'll open the image in a new window
and you can download it from there
=]
 
miiszxclassiic
post Jul 15 2007, 07:28 PM
Post #6


Senior Member
***

Group: Member
Posts: 50
Joined: Jul 2007
Member No: 541,260



yeh i know all that already I was trying to get around that because I have my whole site in an iframe, so when you click any link thats set to open in a new window it opens in my iframe anyway but the broswer address stays the same.... in other words if i have a clickable link to someones site their whole site opens up in my iframe but the broswer address stays as my site name.

I have different php pages with wordpress and had a no right click code in the header and I couldn't figure out how to make this one page right clickable so ppl can save stuff. I tried taking the code out the header.php and putting the code on all the pages that i wanted to disable right clicking and highlighting but that didn't work ,but ohh well I guess i have some fixing to do. Thanks for the suggestions.
 
ExtremeGimp
post Jul 15 2007, 10:07 PM
Post #7


Newbie
*

Group: Member
Posts: 6
Joined: Jul 2007
Member No: 546,468



If you set up the targets for the links right they should ALL open in your iframe...
I mean, I'm assuming that your iframe (e.g. named content) is set as your default target for all links...

When setting up a link try using
CODE
<a href="http://www.yoursite.com" target="_blank">LINK</a>


I saw you said you were using PHP... but I've never used that properly so don't know what the equivelent would be =\
 
*tripvertigo*
post Jul 16 2007, 11:18 AM
Post #8





Guest






theres just no reason to be using php and iframes on the same site. it's called "includes." Look it up.

iframes just shouldnt be used ever again, in my opinion. BAD.
 
threepointone
post Jul 19 2007, 11:15 PM
Post #9


Senior Member
****

Group: Member
Posts: 122
Joined: Feb 2005
Member No: 106,057



There is a way to do it, and it involves either PHP / some sort of server side scripting or a server setting, which I'd doubt your host would allow. Personally I usually work with ASP, so I don't know the exact syntax for PHP, but look through the PHP reference for setting something called the MIME type. If you can have the php file send the image file (so your image is downloaded directly by the php file, such as image.php?image=thingy.jpg without any redirects or html), set the MIME type to "application/octet-stream". Additionally, you'll also need to set the content-disposition header, as described here: http://support.microsoft.com/kb/260519 (doesn't show PHP syntax, though).

A simpler way would be to have a server setting so that all jpeg files in, say, the "downloads" folder will automatically have the MIME type and content-disposition header set as described above.

I wish I could give you a more specific example, but unfortunately I'm not much of a PHP coder =(
 

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: