Web :: Browser issues :: onclick "save target as" excel |
|||
| By: Bernard |
Date: 09/09/2005 08:43:35 |
Points: 20 | Status: Answered Quality : Excellent |
|
Hi, I generate a report in a comma delimited file and give it a name like MyReport.csv . I then set an hyperlink to point to the file. HyperLink1.text = "Download" Hyperlink1.NavigateUrl = "MyReport.csv" When the user clicks the hyperLink I would always like to see the dialog come up that asks if you want to 'Open' the file or 'Save' the file to disk. I get mixed results. If the client has Excel installed then this dialog does not come up and IE pops the file into a spread sheet. If Excel is not installed then IE pops the file up in a text window (same thing happens if I delete the csv from the folder options). If I change the file extension to something strange like .xyz123 then it always comes up with the dialog but I want the user to have the option to save the file as csv. Anyway, is there some way to force this to always come up with the Open or Save dialog? Tks, |
|||
| By: VGR | Date: 09/09/2005 08:51:00 | Type : Answer |
|
| Hello. This is answered in the PAQ but again the solution is relatively simple : use either Response.ContentType="application/octet-stream" or Response.ContentType ="application/save" or (if the webserver has a directive AddHandler send-as-is asis ) Response.ContentType ="asis"Best regards |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








