HTML to a file via META tags

DataCollab used Ask the Experts™
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?
Watch Question

Do more with

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

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

Instead try

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

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.
Michel PlungjanIT Expert
Top Expert 2009

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


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
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