 |
| Classic ASP Components Discussions specific to components in ASP 3. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 18th, 2005, 08:25 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Downloading Images
Hi,
I have an image getting displayed on a page.I want to add to hyperlinks below it to download the image at high and low resolution.How can I do that.Please advice.
Thanks,
Priti
|
|

June 18th, 2005, 08:31 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
treat it like a document, place it in an anchor tag. You will obviously need two of them, one for each image.
Wind is your friend
Matt
|
|

June 19th, 2005, 03:33 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for replying matt.I did as you suggested
I tried using an anchor like this giving path using 'http' and mentioning the drive::
<a href="http://server_name/images/HIGH_RES_IMAGE_NAME.gif">Download High resolution image</a>
<a href="f:/images/HIGH_RES_IMAGE_NAME.gif">Download High resolution image</a>
With that, on click of hyperlink the image gets opened up in same browser window and doesnot pop up for download.
Priti
|
|

June 19th, 2005, 03:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You may want to take a look at this FAQ: http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=189
It explains how to force the Save As dialog with an ASP page...
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 19th, 2005, 06:08 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Imar - Five stars fot that article, very helpful.
Wind is your friend
Matt
|
|

June 21st, 2005, 07:34 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello,
Thanks a lot,the article was good and very useful.I have a parent page which open the page in new window focing save as dialog box.After the user has saved the file the window remain closed.How to close the window.As if I write javascript as mentioned below it does not goes to the browser.
<%
FileName = request.querystring("Filename")
FullFileName = "F:/inetpub/wwwroot/download/"&FileName
Response.ContentType = "application/x-unknown"
Response.Addheader "Content-Disposition", "attachment; filename=" & chr(34) & FileName & chr(34)
Response.Binarywrite GetBinaryFile(FullFileName)
Function GetBinaryFile(ByRef FileSpec)
Const adTypeBinary = 1
Dim objStream
Set objStream = Server.Createobject("ADODB.Stream")
objStream.Open()
objStream.Type = adTypeBinary
objStream.LoadFromFile FileSpec
GetBinaryFile = objStream.Read()
Set objStream = Nothing
End Function
%>
<html>
<head>
<script language="Javascript">
function cls()
{
window.close();
}
</script>
</head>
<body onload=cls()>
</body>
</html>
Thanks,
Priti
|
|

June 21st, 2005, 07:37 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
further to my reply if i try to close the child window through javascript in parent window then the save as dialog box does not appear and the child window gets closed without doing anything.
Thanks,
Priti
|
|

June 21st, 2005, 02:34 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You don't need an additional window. Just link to the page directly. The browser will see you're downloading a file and leave the current page in tact.
So, something like:
<a href="DownloadFile.asp?Id=123">Download</a>
would work fine. It shows the download dialog as a separate dialog, without affecting the page that has the link.
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

June 23rd, 2005, 05:49 AM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks a lot Imar.It worked.
Priti.
|
|

September 11th, 2005, 10:55 PM
|
|
Registered User
|
|
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I have made similar code, however, after the force-download dialog appeared, is it possible to detect if user press "Cancel" button?.
-Ian-
|
|
 |