Solved

FileUpload: Content-Type disparity between Firefox & IE

Posted on 2006-11-01
3
406 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

Independent Software Vendors: 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

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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