codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  `save as` option for XML files  hulkphil at 15:53 on Friday, November 21, 2003
 

Hello Forum,
I have a question regarding bringing a 'save as' prompt for XML files (instead of opening the file in a browser as browser interprets the XML format).

My 'download.html' has a hyperlink to the xml file. 'On Click' ing this hyperlink a new window is supposed to open up with the 'save as' prompt, as I want my parent html page to be still in place for more downloads.

Here is JS and html code I am using:

<script language="JavaScript" type="text/JavaScript">
function openDownLoadPrompt(URL){
var window1=window.open(URL,'mywindow','width=600,height=500,screenX=0,screenY=0,left=0,top=0,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes');

window1.document.execCommand("SaveAs","1","");

}

</script>

<a href="#" onClick=openDownLoadPrompt("/forum/sample.xml")>
Download XML </a>


The problem I am having is a 'save as' option is shown in the new window before the XML loads, and if I save it a blank document is saved.

I really appreciate it if any one can suggest me how to let the XML document load before I use 'execCommand', or any other alternative way of achieving the same would also be great.
Thanks to you all in advance.
Phani

















CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: C++ Beginner question
•  Re: function within loop problem
•  moncler outlet
•  Re: Display swf file in pdf
•  Re: how to create forum using asp.net with c# language?
•  Discount coach store
•  Create Better Maps with Global Mapper
•  Re: How to display a message box when record is temporary stored in session/grid view
•  Sharing object in perl


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012