FileUpload issue in IE7 -

Last post 01-31-2007 1:09 PM by lizgee. 7 replies.

Sort Posts:

  • FileUpload issue in IE7 -

    01-08-2007, 10:51 AM
    • Loading...
    • sbyard
    • Joined on 03-26-2003, 3:42 AM
    • North Yorkshire - England
    • Posts 1,176

    Using the simple code below, attempting to upload an MPG file causes the browser to display a new page :- "Internet Explorer Cannot Display the Web Page".  Looks like the issue is in Explorer, rather than the code.  I posted some issues to Microsoft regarding this controls operation in IE late last year.

     

    I am using IE7 64 bit.

    <%

    @ Page Language="C#" %>

    <!

    DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <

    script runat="server">

    protected void LinkButton1_Click(object sender, EventArgs e)

    {

    FileUpload1.SaveAs(MapPath(

    "~/App_Data/" + FileUpload1.FileName));

    }

    </

    script>

    <

    html xmlns="http://www.w3.org/1999/xhtml">

    <

    head runat="server">

    <title>Untitled Page</title>

    </

    head>

    <

    body>

    <form id="form1" runat="server">

    <asp:FileUpload ID="FileUpload1" runat="server" />

    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">LinkButton</asp:LinkButton>

    </form>

    </

    body>

    </

    html>
    If it was easy, everybody would be doing it.
  • Re: FileUpload issue in IE7 -

    01-08-2007, 11:47 AM
    • Loading...
    • jstawski
    • Joined on 12-10-2002, 3:44 PM
    • United States
    • Posts 368
    Have you tried the same code and adding the following attribute to the form tag: enctype="multipart/form-data"?
    JoNaS
    MVP - Microsoft Most Valuable Professional
    MCAD - Microsoft Certified Application Developer
    http://www.jstawski.com
  • Re: FileUpload issue in IE7 -

    01-09-2007, 3:43 AM
    • Loading...
    • sbyard
    • Joined on 03-26-2003, 3:42 AM
    • North Yorkshire - England
    • Posts 1,176

    Yes - it makes no difference - still the same issue

    If it was easy, everybody would be doing it.
  • Re: FileUpload issue in IE7 -

    01-09-2007, 3:55 AM
    • Loading...
    • venkatarajana
    • Joined on 07-01-2005, 8:35 AM
    • Bangalore,India
    • Posts 13

    Is the file upload working properly with the other browsers? Anything to do with the maxRequestLength in web.config or machine.config?

     

    Regards,

    Venkatarajan A 

    Plan for the Worst,
    Hope for the Best
  • Re: FileUpload issue in IE7 -

    01-09-2007, 4:07 AM
    • Loading...
    • sbyard
    • Joined on 03-26-2003, 3:42 AM
    • North Yorkshire - England
    • Posts 1,176

    Yes

    I was going through the event log after my last post and noticed the following

    HttpException

    Maximum request length exceeded.

    So I added the following system.web setting which solved the problem.  The web site under design won't actually upload large files, I was just testing to ensure only image files would be accepted and though the MPEG was small, but in fact it was 300M - justs shows the worthwhileness of testing!  Thanks for your input.

    <

    httpRuntime maxRequestLength="4096000"/>
    If it was easy, everybody would be doing it.
  • Re: FileUpload issue in IE7 -

    01-25-2007, 1:26 AM
    • Loading...
    • lizgee
    • Joined on 01-25-2007, 1:14 AM
    • Posts 8

    I just joined this site, and am working on similar issues.  I have already incorporated all the suggestions in this thread, and in addition, am displaying an image prior to uploading using javascript.  This seems to work fine in IE 6, but not IE 7.

    <script language="javascript"  type="text/javascript">
    function showBrowse(pFile, idx)
    {
    imgThumb = eval("document.images.img" + idx);
    imgThumb.src = pFile;
    }
    </script>
    ...

    <asp:FileUpload ID="PhotoFile0" runat="server" onchange="showBrowse(this.value,0);" />

     <img id="img0" alt="imgQ0" height="48" width="64" src="../Images/bg/spacer.gif" runat="server"/>

  • Re: FileUpload issue in IE7 -

    01-25-2007, 2:28 PM
    • Loading...
    • PeterBrunone
    • Joined on 06-19-2002, 9:15 AM
    • I'm standing behind you.
    • Posts 3,663
    • TrustedFriends-MVPs

    Just to be clear, what exactly are you seeing?  If the error message is ambiguous (i.e. "this page cannot be displayed"), make sure you've turned off "Friendly error messages" in Tools->Internet Options->Advanced so you can see the real error.

     

    Peter Brunone
    MS MVP, ASP.NET
    Founder, EasyListBox.com
    Do the impossible, and go home early.
  • Re: FileUpload issue in IE7 -

    01-31-2007, 1:09 PM
    • Loading...
    • lizgee
    • Joined on 01-25-2007, 1:14 AM
    • Posts 8

    Turned off the "Friendly error messages" and found no error.  I have been checking these file upload pages on various browsers and found that on Netscape 8.1 if I do the

    • - type about:config in the addressbar
      - type security.checkloaduri
      - doubleclick the value found to be set to FALSE

    This works only if I also open the Netscape Security Center and disable ID Theft Protection and Spyware Protection.

    Are there other settings in IE 7 that could make it possible to preview images for FileUpload? 

Page 1 of 1 (8 items)
Microsoft Communities
Page view counter