Downloading file in firefox
-
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
-
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
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 )
-
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 )
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
-
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
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 )
-
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 )
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
-
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
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 )