Reply LinkBack Thread Tools Search this Thread
Old 03-11-2006, 19:42   #1 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,097
Why doesn't this serverside application work in Internet Explorer? (asp.net c#)

In the CMS for a site I have built, I have included a form that allows the user to upload an image to use on the website's pages. It doesnt work in Internet Explorer, but it works fine in Firefox and Opera (and possibly other non-microsoft browsers?)

Senario (in Firefox/Opera):
User browses for an image file, enters a name, clicks upload. It is then checked to see if it is under 100kb, then to see if it is a gif/jpg/png, and it if has a name. If it fails on any of these there appropriate error is returned to the user.

Senario (in IE6 and IE7 on 2 different computers in different places):
User browses for an image file, enters a name, clicks upload. An error is returned: "The image must be either a .jpg / .gif / .png! Please try again!". It does this when trying to upload any type of file, and wrongly comes up when trying to upload a suitable image.

I went into work today to show off my wonderfully working CMS, demonstrating it in IE, and it doesnt fucking work. What have I done wrong? In my years of playing with PHP I have never come across stuff like this, I assumed that a serverside language would work regardless of browser. I had a problem with a asp.net contact form before, but that was just because of the smartnavigation or something fucking things up (which I always disable in web.config now)

I am prepared to test my pages appearance in IE6, IE7, Firefox and Opera - for xhtml/css bugs as that is expected, and work out fixes for those. But a serverside application not working in Microsoft's own browser, yet is working fine in other browsers, just takes the piss.

I wrongly assumed using a framework like ASP.net was ment to be speeding the whole process of creating websites up. But to me it feels like I am trying to cross a pit of quicksand.

Code:

[FIXED]

Last edited by freelancr : 03-11-2006 at 21:02.
  Reply With Quote
Old 03-11-2006, 20:39   #2 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
I imaging it's a mime type thing. Get it to echo out the mime type and see what it comes up with. That's alway s been my problem with this kind of thing.
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Old 03-11-2006, 20:56   #3 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,097
Quote:
Originally Posted by stickmus
I imaging it's a mime type thing. Get it to echo out the mime type and see what it comes up with. That's alway s been my problem with this kind of thing.

Cheers for the reply, a developer at work suggested I echo out the type too on the phone about 5 minutes ago. Managed to get it working now. Internet explorer sees the mime types as:

png = "image/x-png"
jpeg = "image/pjpeg"

Glad it wasnt an asp.net issue because I was tempted to jack it all in and go back to php (which an equivalent script testing for the same thing would have given the same error)

Suppose I just need to do more testing in the future.
  Reply With Quote
Old 03-11-2006, 22:45   #4 (permalink)
stickmus
hmmm...
 
stickmus's Avatar
 
Join Date: Jan 2004
Location: Yorkuk
Posts: 2,130
I think php's image_type_to_mime_type sorts that out for you...
__________________
George Smith - a vain attempt to get higher on google for my name

  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8