aka_damo
asked on
Download Link
Hey,
I've a website that creates files dynamically from a database and then creates a link to the created file so that someone can click on the link to download the file. The file I'm making is a .csv file and it's created fine. The problem is that when someone clicks on the link it just opens the file in the browser. I want to be able to get the usual popup of opening the file (using excel) or saving it,
help badly needed
aka_damo
I've a website that creates files dynamically from a database and then creates a link to the created file so that someone can click on the link to download the file. The file I'm making is a .csv file and it's created fine. The problem is that when someone clicks on the link it just opens the file in the browser. I want to be able to get the usual popup of opening the file (using excel) or saving it,
help badly needed
aka_damo
ASKER
objects,
All I have is a jsp page with the following
Click <a href="report.csv">HERE</a> to Download Report
report.csv is stored in the root directory of the application
All I have is a jsp page with the following
Click <a href="report.csv">HERE</a>
report.csv is stored in the root directory of the application
try:
<a href="report.csv" type="application/vnd.ms-e xcel">HERE </a>
<a href="report.csv" type="application/vnd.ms-e
well from a href.. its really not in your hands.... its in the browser's hand how he wants to handle a particular type of file.
You might try to make fool of the browser by doing
<a href="report.csv" type="application/octent-s tream>HERE </a>
or
<a href="report.csv" type="application/download it>HERE</a >
and see if browser likes it...
You might try to make fool of the browser by doing
<a href="report.csv" type="application/octent-s
or
<a href="report.csv" type="application/download
and see if browser likes it...
ASKER
Tried that, still not working. Just doing the same thing as before
May be dependant on the browser settings, ie. how it is configured to handle csv files.
ASKER
I've tried it for every type of file but it's still not working. I tried it for .xls files that I created with excel and It still won't work
okay rename your file to be as report.tst... and see what it does
ASKER
Did that, tried .tst and .txt, both give me the same result. If i try and open a proper excel file the browser just prints out the binary junk that notepad would show
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
should be something like: application/vnd.ms-excel