View Full Version : image link
petra
06-30-2003, 08:09 PM
I'm new at coding and am ready to finish up a new site. My question is probably stupidly-simple to most of you.
I have a table with images for download. I have zipped the images separately in a subfolder of that page. How do I write the code so that when a visitor clicks the image, it retrieves the zip file for download?
Petra
pardicity3
06-30-2003, 08:23 PM
Welcome!
If the file is zipped all that is required to initiate a download is simply linking to the file. Something like so shall do quite nicely:
<a href="myfile.zip">Download File</a>
petra
06-30-2003, 08:31 PM
Bless you!! I have some pages all set and all works except I could not find out how to link these thumbs to their respective zips.
I truly appreciate your speedy response!!
Best
Petra
oracleguy
06-30-2003, 10:15 PM
Just put the link tags around the image tag for your thumbnails.
e.g.
<a href="image01.zip"><img src="blah.jpg" alt="blah" border="0"></a>
<a href="image01.zip" title="put some words here for popup tooltip"><img src="blah.jpg" alt="blah" border="0"></a>
MotherNatrsSon
07-01-2003, 12:55 AM
Isn't "image source" depricated and to be "valid" it has to be the "object" reference?
MNS
oracleguy
07-01-2003, 02:16 AM
Originally posted by MotherNatrsSon
Isn't "image source" depricated and to be "valid" it has to be the "object" reference?
MNS
Well they never said what doc type they were using.
According to jkd the object thing doesn't happen until XHTML 2.0
petra
07-01-2003, 06:13 AM
I tried it Mike's way first and I got lost - it set "Download File" beneath each thumbnail and it was a bit unattractive. The Table was then out of balance. In certain circumstances, though, I'm sure it will work just dine!
After reading a few more posts looking for one on my subject, I grabbed my books and worked on it until I found the answer - nothing like a boatload of webheads on a forum to make us truly-newlies want to work harder!
So, in order to make an image in a table cell into a link to click in order to retrieve the zip file copy of itself:
<tr><td><a href="JSC Rose Antique.zip"><img src="jsc _rose_antique.gif" border="0" alt="Get Antique Rose!"/></td>
Oracleguy - think you had the right track with your information!
To everyone who stepped up to take a swing at this - My hat is off to you! Thank You!!
Best,
Petra
Nightfire
07-01-2003, 01:26 PM
<tr><td><a href="JSC%20Rose%20Antique.zip"><img src="jsc _rose_antique.gif" border="0" alt="Get Antique Rose!" /></a></td> ;)
ronaldb66
07-01-2003, 03:49 PM
The img element still appears in the XHTML 1.1 Image module; as Oracleguy mentioned, the first version that it has disappeared from in favour of the object module is XHTML 2.0, but that's still a working draft. Considering the speed with which most user agents have taken up recent standards, we'll be well underway towards 2010 before the img element actually starts losing support.
Nightfire
07-01-2003, 03:57 PM
Once the img has gone, what do you use to add images? object tags?
pardicity3
07-01-2003, 05:29 PM
You sir, are correct. I believe you can even use the object tag right now (with varying results of course :)).
<tr><td><a href="JSC%20Rose%20Antique.zip" title="put some words here for popup tooltip"><img src="jsc _rose_antique.gif" border="0" alt="Get Antique Rose!" /></a></td>
aaarrrggghhhhh!! Don't put spaces or %20 into filenames. Why not use-hyphens-instead!
Use all lower case for filenames too.
And, you only need that closing / on the <img> tag if you are using XHTML. If you are using plain HTML than you should remove it.
Roy Sinclair
07-02-2003, 02:47 PM
And, you only need that closing / on the <img> tag if you are using XHTML. If you are using plain HTML than you should remove it.
No! xHTML is the future and it doesn't hurt your page to be closer to valid syntax. I don't know of any browser that chokes on that valid syntax so it's a bad idea to leave it off when you can remember to put it in. Even if you aren't coding to xHTML yet there's no reason not to work on your code to make the eventual transition to xHTML easier for you.
ronaldb66
07-02-2003, 02:59 PM
Depends on the DTD used. If the page has to validate as HTML 4.01, they should go. Browsers won't mind, the validator will.
Roy Sinclair
07-02-2003, 03:26 PM
Originally posted by ronaldb66
Depends on the DTD used. If the page has to validate as HTML 4.01, they should go. Browsers won't mind, the validator will.
Somebody should fix the validator then. Even HTML 4.01 is supposed to be a subset of SGML so it shouldn't reject valid syntax.
oracleguy
07-02-2003, 10:21 PM
But it does, I've ran into that problem before.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.