Making an image downloadable |
![]() ![]() |
Making an image downloadable |
![]()
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
|
|
|
*SinfullySweet* |
![]()
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
![]() |
|
|
![]()
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.
![]() |
|
|
*tripvertigo* |
![]()
Post
#4
|
Guest ![]() |
no, just LINK the image, in an anchor tag (<a href="http://yoursite.com/yourimage.jpg">download image </a>)
|
|
|
![]()
Post
#5
|
|
![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,011 Joined: Jun 2007 Member No: 533,410 ![]() |
|
|
|
![]()
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. |
|
|
![]()
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
#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. |
|
|
![]()
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 =( |
|
|
![]() ![]() |