HTML to a file via META tags

DataCollab
DataCollab used Ask the Experts™
on
I'm trying to send a web page to a browser and have the browser popup a file dialog window, so that the user can save the results to a .csv file. I have created a test file, which is attached, but the web browser doesn't open a file dialog when I execute this page. What am I missing?
Progress-CSV.htm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Michel PlungjanIT Expert
Top Expert 2009

Commented:
That will never work.
You cannot change the page to be csv inside html.

Instead try

<html>
<head>
<script type="text/javascript">
location='progress.csv';
</script>
</head>
<body>
<a href="progress.csv">Download progress.csv if it does not load automatically</a>
Wayne BarronAuthor, Web Developer
Top Expert 2009

Commented:
mplug
I do not think that he is wanting to change the page to be a csv inside of an html page.
He is wanting a dialog to open when the page loads so the user can save the content of the csv to their computer for later viewing.

I think that you might have mistaken his renaming of the file to Progress-CSV.html
To post here.

If I am wrong, please excuse me for speaking out.
Carrzkiss
Michel PlungjanIT Expert
Top Expert 2009

Commented:
Only html or xhtml can have meta tags
It seems to me he wants to load an html file and have the meta tags force the browser to think it is a csv

Author

Commented:
Apologies if I was unclear. I'm essentially trying to do the equivalent of the following ColdFusion code:
      <cfheader name="Content-Disposition" value="inline; filename=Results.xls">
      <cfcontent type="application/vnd.excel">
When ColdFusion finishes processing, and sends the resultant page to the browser, a file dialog appears (with a default filenane of Results.xls) asking the user where to save the results. I'd like to be able to generate an HTML page that does the same thing without having to go through ColdFusion first.
IT Expert
Top Expert 2009
Commented:
And the answer is not possible unless you have the html page load another page that IS csv

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial