473,378 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

trying to open a save dialog box using javascript

I want to open a save dialog box instead of bringing up the file's data within the browser. I have read in other posts how to do that, but I am having problems with it. The file contents is still opening up within the browser. Below is my code. Any help will be appreciated.
Expand|Select|Wrap|Line Numbers
  1. <%@ Language="JavaScript"%>
  2. <% Response.expires = 0 %>
  3.  
  4.  
  5. <%
  6.  
  7. var szFile;
  8. if(String(Request("dataFile")) != "undefined") { 
  9.   szFile = String(Request("dataFile"));
  10. }
  11.  
  12.     Response.ContentType="application/save";
  13.     Response.AddHeader("Content-Disposition","attachment; filename = szFile")
  14.     Response.Redirect(szFile);
  15.  
  16. %>
Aug 21 '08 #1
1 6360
jhardman
3,406 Expert 2GB
I think the problem is the redirect, I think that overwrites the http header. Can you open the file using a binary stream and send it to them at that point rather than redirecting? I could do it in vbscript, but I don't think I know how to do it in javascript.

Jared
Aug 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: eddie wang | last post by:
Excel open automatically without giving a dialog box option to Open/Save/Cancel using filesys.createTextFile. How to pop up the dialog box option to Open/Save/Cancel? Thanks.
1
by: Venkat | last post by:
Hi, I have an file1.exe file stored at some physical location say C:\Test\file1.exe. I created a virtual folder say MyFolder pointing to my physical folder(C:\Test\). I wrote this piece of...
2
by: Ronnie Jensen | last post by:
Hi There. Unfortunally I forgot how to create an open/save dialog (Access 2000), from which I can retrieve the the filename to open/save. Can anyone tell me how.. Thanks in advance Ronnie
1
by: ASH | last post by:
Hello all, I'm using the "API: Call Windows File Open/Save Dialog Box" to source the name of a file to open. The Dialog Box when called opens in the top left hand corner of the screen. I have...
2
by: SpotNet | last post by:
Hi Newsgroup, I have constructed highly customisable common dialog classes\objects. Decided to extend the Open\Save dialog options with the ability to change the text on all the controls. ...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
6
by: Michael Groeger | last post by:
Hi, I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save...
0
by: de4ever | last post by:
I have used open/save dialog box inside update panel in asp.net.but it is not working because of the code line Response.WriteFile(path);.Can i use any thing else for opening a file through open/save...
0
by: miztaken | last post by:
Hi Everyone, Is it possible to customize.net's default File Open/Save Dialog Box to display only selected folders in PC according to user's privilege. I want to totally hide the Special Folders...
0
by: raulbolanos | last post by:
I guys, I got 2 days trying to go thought this and I cannot figure out how to solve it, hope you can help me out here. I have a ASP Web Application, as simple as this; <%@ Page Language="C#"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.