Solved

FileUpload: Content-Type disparity between Firefox & IE

Posted on 2006-11-01
3
407 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
[X]
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
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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