...

View Full Version : Download Image?



Athmaus
04-15-2005, 04:05 AM
I have this javascript photo album i made. It is all working in tables and such. When you roll over a certain cell it will show that picture above, and turn the cell a different color. I also made the cell "clickable" when they are on it.

Is there anyway i can get it to when someone clicks that cell, that it will download that picture?? I have looked everywhere but i have not see anythign that will allow me to do that. Any ideas?

Here is the snippit of the code when you roll over that cell:

<tr bordercolor="white">
<td class="menu" bordercolor="000000" style="cursor:hand" onMouseOver="doButtons('candyhat'),movein(this)" onMouseOut="doButtons('a'),moveout(this)" onClick="MM_goToURL('parent','#');return document.MM_returnValue""><div align="center">
<p>Gold Hat</p>

glenngv
04-15-2005, 08:34 AM
It cannot be done with Javascript. Are you using a server-side language? I know of an ASP script that can force download any file.

Athmaus
04-15-2005, 06:39 PM
yes i can use ASP on this page.

glenngv
04-18-2005, 06:00 AM
You might get an idea from this thread (http://www.codingforums.com/showthread.php?t=56356). You will use the same script that I gave to the thread starter. You will just specify different value for the parameter in the SendStreamToBrowser subroutine.

SendStreamToBrowser LoadStream(localPathOfFile), filename, "", false

If that doesn't work, use:

SendStreamToBrowser LoadStream(localPathOfFile), filename, false, false

_Aerospace_Eng_
04-18-2005, 06:05 AM
What about php can u use php also? You can use the headers to pass off a file as an attachment, and then just link to the php page that has the correct headers in it.

Athmaus
04-18-2005, 07:14 PM
What about php can u use php also? You can use the headers to pass off a file as an attachment, and then just link to the php page that has the correct headers in it.

I am already using ASP for the login and session's already so i dont think i can use php (plus i have zero expierence with php)

glenngv,

I will try that script out and let you konw later on thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum