Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To 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
  #1 (permalink)  
Old September 19th, 2008, 04:45 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: , Texas, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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....



  #2 (permalink)  
Old September 20th, 2008, 04:50 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And the error / question / problem is what, exactly?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Dialog Box hari.gomatum Javascript 3 October 4th, 2007 02:09 AM
Dynamic Dialog Box peace2007 Ajax 1 September 26th, 2007 08:26 AM
Save Dialog Box Camer Servlets 9 February 23rd, 2006 09:10 AM
how to call saveas box in asp.net sumeghagupta General .NET 9 September 30th, 2004 11:56 AM
insert dialog box in a dialog box BurhanKhan Visual C++ 7 June 1st, 2004 07:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.