Skip to main content
Inspiring
April 19, 2007
Question

Select items and download as file

  • April 19, 2007
  • 6 replies
  • 484 views
I have a simple mysql database table, which is displayed as "Select
newsID, newshead, newsdate". The results I would like to offer as a
download file. Is there a way to accomplish that?

Regards
Martin Lang
This topic has been closed for replies.

6 replies

Inspiring
April 19, 2007
Thanks :))
Inspiring
April 19, 2007
lol Didn't hit paste!! ooOOPS!

http://www.w3schools.com/asp/prop_contenttype.asp

--
Piers


Inspiring
April 19, 2007
Thank you for your help. Although I'm working with php I would like to
study your solution for ASP/VB. Could you give me the link?

Martin Lang
Inspiring
April 19, 2007
If you're using ASP VBScript, example here of how to download as an Excel
file.

Just adapt the HTML table for your code.

--
Piers


Inspiring
April 19, 2007
Hi geschenk,

thank you for the links, but even the first one is far beyond my
abilities. So downloading the results as excel-file or just as simple
textfile would do it.

Martin Lang
Günter_Schenk
Inspiring
April 19, 2007
Hi Martin,

when exporting to Excel, you could for instance use FelixOne´s FX Import-Export CSV extension or Linecraft´s "Export to Excel" Server Behavior which both will generate a Comma-delimited (.csv) file out of a Recordset without writing it to the hosting server. Your web site user will be prompted to save the file to the hard drive to be open with Microsoft Excel.

"Linecraft" also provides an extension suite named "Save to Microsoft Word or Excel" that´s exporting a web page (not a recordset) as either Word (doc) or Excel (xls) file.

For other related solutions just google for "dreamweaver extension excel export "
Günter_Schenk
Inspiring
April 19, 2007
>>
The results I would like to offer as a download file
>>

what file type ? what´s your server side scripting language, PHP ?

>>
Is there a way to accomplish that?
>>

you´d probably need a server side "on the fly" generation of the respective recordset´s result to, say, PDF. For PHP you´ll find some existing solutions like the R&OS pdf class for generating rather simply structured PDF´s or html2ps and html2pdf for generating "advanced" PDF´s