Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want the users of my application

Status
Not open for further replies.

tomdede

Programmer
Mar 16, 2001
2
US
I want the users of my application to be able to open a CSV (comma separated values) file. Using the following javascript, I get the IE File Download dialog that asks the user if they want to "Open this file from its current location" or "save this file to disk". When I select "open", I get a new window with the data presented in an Excel spreadsheet. This is exactly the behavior I want. However, when I select "save" I get a new window with the "No page to display" message. I can close the window and save the file, but I am looking for a solution that prevents the window from being displayed at all. Any help would be appreciated.

<html>
<body>
<input type=&quot;button&quot; value=&quot;Open CSV&quot; LANGUAGE=javascript onclick=javascript:window.open(&quot;Documents/test.csv&quot;)>
</body>
</html>
 
I don't know if I really understand your question but did you try :
javascript:window.open('Documents/test.csv', '_self')
 
Thanks, SeAL. Although this causes the spreadsheet to be diplayed in the same window as my application instead of a new window, it will work just fine. Thanks again.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top