Solved

create a xls file download without physical file

Posted on 2007-03-30
3
167 Views
Last Modified: 2013-11-19
morning,

I am trying to export some info from my database by creating a downloadable xls file.
i know how to build this using comma delimited (although any tips or pointers would be beneficial) but i don't want to create a physical file on the server for the download.

I have used this is the past but can't remember how to do this, ideally i want to create the file in memory and offer as a save for the user

Cheers
0
Comment
Question by:bhendrick
[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
3 Comments
 
LVL 5

Accepted Solution

by:
mihaimm earned 250 total points
ID: 18839778
You need to set the content-type header of the http response to the proper mime-type of csv (text/csv). By default anything served should be text/html. If you set it to somthing else (like text/csv) the browser should ask the user what to do with it. If you want Excel to be selected you can set it to application/vnd.ms-excel (but that would not be entierly proper).

So... just write... whatever language you write in order to output instead of HTML a csv format and then set the content-type header (this depends a lot on the language/server you use).
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

697 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