Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Downloading file in firefox

Downloading file in firefox

Scheduled Pinned Locked Moved ASP.NET
csharp
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr Sam
    wrote on last edited by
    #1

    Hi all... I have a vcalendar (.vcs) file, which is actually an outlook meeting file which I contruct through StreamWriter in .net. I provide a link to download it, and it is downloaded perfectly in Internet Explorer. But when i try to download it in Firefox its content is opened in browser. I want a way to download it in Firefox as well. Please note that this file can also be opened in a text Editors like MS word, wordpad, Excel etc etc... Waiting for response.

    Bye

    C 1 Reply Last reply
    0
    • M Mr Sam

      Hi all... I have a vcalendar (.vcs) file, which is actually an outlook meeting file which I contruct through StreamWriter in .net. I provide a link to download it, and it is downloaded perfectly in Internet Explorer. But when i try to download it in Firefox its content is opened in browser. I want a way to download it in Firefox as well. Please note that this file can also be opened in a text Editors like MS word, wordpad, Excel etc etc... Waiting for response.

      Bye

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Make sure you set the mime type of the file, IE probably works it out for itself.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M 1 Reply Last reply
      0
      • C Christian Graus

        Make sure you set the mime type of the file, IE probably works it out for itself.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        Mr Sam
        wrote on last edited by
        #3

        How can i define the mime type .. Please give me the hint. for example if i use streamwriter to in a txt file, how can i define it as .txt. By the way i append .vcs in the link which downloads the file and also in the file appending "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN" thx -- modified at 10:18 Sunday 9th September, 2007

        Bye

        C 1 Reply Last reply
        0
        • M Mr Sam

          How can i define the mime type .. Please give me the hint. for example if i use streamwriter to in a txt file, how can i define it as .txt. By the way i append .vcs in the link which downloads the file and also in the file appending "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN" thx -- modified at 10:18 Sunday 9th September, 2007

          Bye

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          If you're sending the file with a response.Write, then the Response object is also used to set the MIME type. If you're not, how are you doing it ?

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          M 1 Reply Last reply
          0
          • C Christian Graus

            If you're sending the file with a response.Write, then the Response object is also used to set the MIME type. If you're not, how are you doing it ?

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            M Offline
            M Offline
            Mr Sam
            wrote on last edited by
            #5

            I am using the streamwriter to write the file. In start.... l_strFilename = Server.MapPath("../../" + MZKBase._SysGenExcelFilePath + l_strGuid & ".VCS") Dim l_oWriter As System.IO.StreamWriter = New System.IO.StreamWriter(l_strFilename) l_oWriter.WriteLine("BEGIN:VCALENDAR") l_oWriter.WriteLine("PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN") l_oWriter.WriteLine("VERSION:1.0") l_oWriter.WriteLine("BEGIN:VEVENT") l_oDueDate = TimeZone.CurrentTimeZone.ToUniversalTime(l_oDueDate) l_oString.Append("DTSTART:") l_oString.Append(AppendZero(l_oDueDate.Year.ToString())) ...Rest of the File... l_oWriter.WriteLine("PRIORITY:3") l_oWriter.WriteLine("END:VEVENT") l_oWriter.WriteLine("END:VCALENDAR") l_oWriter.Close() And in the end l_oString = New Text.StringBuilder l_oString.Append(" Save As
            ") To show the link saveas...

            Bye

            C 1 Reply Last reply
            0
            • M Mr Sam

              I am using the streamwriter to write the file. In start.... l_strFilename = Server.MapPath("../../" + MZKBase._SysGenExcelFilePath + l_strGuid & ".VCS") Dim l_oWriter As System.IO.StreamWriter = New System.IO.StreamWriter(l_strFilename) l_oWriter.WriteLine("BEGIN:VCALENDAR") l_oWriter.WriteLine("PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN") l_oWriter.WriteLine("VERSION:1.0") l_oWriter.WriteLine("BEGIN:VEVENT") l_oDueDate = TimeZone.CurrentTimeZone.ToUniversalTime(l_oDueDate) l_oString.Append("DTSTART:") l_oString.Append(AppendZero(l_oDueDate.Year.ToString())) ...Rest of the File... l_oWriter.WriteLine("PRIORITY:3") l_oWriter.WriteLine("END:VEVENT") l_oWriter.WriteLine("END:VCALENDAR") l_oWriter.Close() And in the end l_oString = New Text.StringBuilder l_oString.Append(" Save As
              ") To show the link saveas...

              Bye

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              OK, you're showing a link. In that case, there's nothing you can do. You'd have to have your link redirect to code that pushes the file down with the right MIME type ( which would be just to specific that it's a file for download ), to make Firefox accept that it should download the file.

              Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups