0

I created an application in vb.net for uploading and downloading a file. On IE and Chrome, it is successfully open with correct extension on clicking at link. But on Mozilla firefox, It is always open in HTML format.

enter image description here

Do I need to change something in the Mozilla Firefox or in my code? It is doing right in Chrome and IE. File can be of any type(.docx,.pdf,.txt).Prompt response will be highly appreciated.

user3179537
  • 23
  • 1
  • 1
  • 10

2 Answers2

0

You need to add the Content-Disposition header to the response. Your server side code should look something like:

Response.Clear()
Response.ContentType = "application/CSV"
Response.AddHeader("content-disposition", "attachment; filename="" + filename + ".csv"")
...  

Here is a similar question:

Community
  • 1
  • 1
Dalorzo
  • 19,834
  • 7
  • 55
  • 102
-1

Try remove white spaces from file name.

  • White spaces shouldn't matter in file names, the above answer was posted as an accepted answer on Jan 9th as the correct response. – Andrew Jun 25 '14 at 21:16