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
Solved

create a xls file download without physical file

Posted on 2007-03-30
3
165 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tutorial for ebay api 3 55
Select record with the most recent date 14 67
What is the optimum percentage to save images for webs. 4 19
WordPress 8 25
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

809 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