Solved

execCommand saveas problem

Posted on 2008-10-14
4
1,351 Views
Last Modified: 2013-12-08
We're using a web service to run reports, and we're trying to save the report out as a CSV file.  When we click to save the file out, we get a two frame window, one of the frames 'DelimitedTop' just has instructions on how to save the file, the other frame is supposed to just invoke the 'save as' dialog to save this CSV file. Instead, it just displays the text in the other frame and does not allow us to save the file out. This works properly on other systems, what can I change to get the behavior that I am expecting?

I've attached the source code of this site and it looks like it is using the execCommand('saveas'...
<html>
<head>
<title>Court Referral Program Delimited File</title>
 
</head>
<script>
function saveAsMe (filename)
{
bottomFrame.document.execCommand('SaveAs',1,filename);
}
 
</script>
 
<frameset rows="20%,*" frameborder="NO" border="0" framespacing="0">
  <frame src="DelimitedTop.asp" name="topFrame" scrolling="Yes" noresize>
  <frame onLoad="saveAsMe('Results.csv');" src="Delimited.asp?sm=0&popup=&refresh=&StartDate=9%2F1%2F2008&r_StartDate=Start+Date+is+required&EndDate=9%2F30%2F2008&r_EndDate=End+Date+is+required&TheFormID=28&Q_WhatType=0" name="bottomFrame" scrolling="Yes" noresize>
</frameset><noframes></noframes>
</html>

Open in new window

0
Comment
Question by:menreeq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:menreeq
ID: 22716389
just an FYI: I am not able to change the site HTML at all.
0
 
LVL 44

Assisted Solution

by:scrathcyboy
scrathcyboy earned 200 total points
ID: 22717792
"This works properly on other systems, what can I change to get the behavior that I am expecting?"

The file save dialog box all depends on how each USER has set up his OWN COMPUTER to save files, and which extensions are to be saved and which are not.  Run windows file manager (explorer) on a system that works, and a system that does not.  Look at tools, folder options, file types, and look for the file extension you want to save.  You will see they are set different on a working system vs. not working.

Synchronize the two.  Also in the browser, this setting can be changed too.  Depends on browser, in FF, or sea monkey, edit preferences, advanced, system, sync the settings there, as well as edit, preferences, navigator, helper applications -- the correct MIME types need to be synced there too.

For IE, it is in control panel, internet options, look around and SYNC the two systems.
0
 

Accepted Solution

by:
menreeq earned 0 total points
ID: 22736171
I checked the two, and the file associations were the same, as well as the IE options.

I found a work around since this is a plaintext file (CSV) to just 'View Source' of the frame, and save it as a CSV file.
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22736755
your initial question did not indicate that all you wanted to do is save the source of the file -- in which case, as you found out, view source, save as -- simple as that.
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question