SaveAs dialog box
Hello
not sure if this has been addressed or not. i am looking for help in haveing a SaveAs dialog box opened when a visitor clicks on a button. the files i want to use for downloading are images. i know that you can just right click on the image and select save picture as. however i want to use the SaveAs dialog box method, how can this be done? the images that are displayed and to be saved are accessed via variables. i have tried the execCommand but cant get it to work.
thanks, john
here is the code from the download.asp file:
<%
sFile = request.querystring("file")
sPath = domaindir & sFile
sName = request.querystring("name")
ContentType = "application/x-msdownload"
Response.Buffer = True
Const adTypeBinary = 1
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile sPath
ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition", "attachment; filename=""" & sName & """"
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>
here is the calling statement:
<script language="JavaScript1.2">document.write('<a href="' + domaindir + '"/download.asp?file="' + photoname + "&name=file%20" + panelname + ".jpg" + '" onmouseover="doTooltip(event,2)" onmouseout="hideTip();">');document.write('<img src="graphics/bullets/computer/floppy_disk_rotation_med.gif" border=0 width=32 heigth=15 alt=""></a>');</script>
thanks for the help....
|