Solved

FileUpload: Content-Type disparity between Firefox & IE

Posted on 2006-11-01
3
397 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
Comment Utility
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
Comment Utility
Thanks, that's very helpful.
0
 
LVL 27

Expert Comment

by:Sammy
Comment Utility
You welcome Mr

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now