Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need to create a .CSV file from ASP...

Posted on 1998-09-28
4
Medium Priority
?
277 Views
Last Modified: 2013-12-25
I want the user to click on a link that is of file type .csv, so that Excel or whatever program they have registered to read comma seperated values gets invoked.  I need ASP to create this file.  But a .CSV file won't get executed as ASP.  So basically how can I get either an ASP file passed back as .CSV, or a .CSV file to be executed as ASP code???

Thank you,
David
0
Comment
Question by:dpinkus
[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
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1855323
Can you be more specific?  Can you post what the CSV file will look like?  What will create the CSV file?
0
 

Author Comment

by:dpinkus
ID: 1855324
A CSV file looks like this:
"value1","value2","value3", etc.
They can be opened from any application that supports this format, generally Excel.  
For an example, go to:  http://quote.yahoo.com/q?s=YHOO&d=t
Then on the bottom click on "Download Spreadsheet Format".  Depending
on how you are configured, either Excel will be launched (sometimes within
your browser) or you will be prompted to save this file to disk.  
I would like to use an ASP script to create the file, but I don't know how
to send it back as a .csv file instead of an html document...

0
 
LVL 10

Accepted Solution

by:
MasseyM earned 150 total points
ID: 1855325
YOu would create the file on the server using what ever you will be using (a program or your scipt) - save it as .csv and then in your ASP script, use this:

response.redirect "physical location of .csv file"

This will send just the csv file to the browser.
0
 

Author Comment

by:dpinkus
ID: 1855326
Perhaps I didn't phrase my question correctly.  I do not want to physically write a file, I want to execute an ASP script that returns a stream of data back to the browser, but tells the browser that it is a .csv file.  I solved this by putting the following at the beginning of my ASP script:
<%
Response.ContentType = "application/vnd.ms-excel"
%>

This did cause the desired behaviour, of launching their EXCEL application to view the file.  I suppose there is a MIME combination that I can use above for CSV, but I do not know what it is...
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

636 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