Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

FileUpload: Content-Type disparity between Firefox & IE

Posted on 2006-11-01
3
405 Views
Last Modified: 2008-02-01
I am creating a file upload utlity very similar to this one: http://authors.aspalliance.com/das/tutorial/test/fileupload2.aspx.

If I upload a simple .txt file the "Content-Type" (FileUpLoad1.PostedFile.ContentType) differs between Firefox and IE:

IE displays "Content type: text/plain"
Firefox displays "Content type: application/save-as"

The problem is that we are going to be storing the files uploaded by the user into a DB and we need to save the content type so that we can stream it properly back to the browser when they go to download the file again from the DB.  With Firefox and IE returning different content types, I can only imagine this will cause problems down the line.

Is this by design? Or will this cause problems later on?
0
Comment
Question by:Mr_Snrub
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy earned 500 total points
ID: 17856071
Mr_Snrub,
1-This is a major difference between IE and FF and its by design.
2-you don't need to save the content type to enable streaming the files for downloads. you can easily force the file download using
Response.ContentType = "application/x-download"
Response.AddHeader("Content-Disposition", "filename=" & any_filename_includding_its_extension)

see this example here
http://www.asp101.com/samples/download_sample_aspx.asp

HTH
0
 

Author Comment

by:Mr_Snrub
ID: 17858035
Thanks, that's very helpful.
0
 
LVL 27

Expert Comment

by:Sammy
ID: 17859766
You welcome Mr

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question