[Mono-bugs] [Bug 58359][Cri] Changed - HtmlInputFile Bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 12 May 2004 21:59:20 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jblawn@cfl.rr.com.

http://bugzilla.ximian.com/show_bug.cgi?id=58359

--- shadow/58359	2004-05-12 02:32:31.000000000 -0400
+++ shadow/58359.tmp.13201	2004-05-12 21:59:20.000000000 -0400
@@ -44,6 +44,98 @@
 a previous version, and it works fine on IIS 6.0/.NET 1.1.
 
 Additional Information:
 
 ------- Additional Comments From gonzalo@ximian.com  2004-05-12 02:32 -------
 Can you attach a test case?
+
+------- Additional Comments From jblawn@cfl.rr.com  2004-05-12 21:59 -------
+::::::::::::::
+WebForm1.aspx
+::::::::::::::
+<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
+AutoEventWireup="false" Inherits="test.WebForm1" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<html>
+   <head>
+      <title>Test</title>
+      <meta name="vs_targetSchema"
+content="http://schemas.microsoft.com/intellisense/ie5">
+   </head>
+   <body>
+      <form id="testForm" method="post" runat="server">
+         <input id="upload" type="file" runat="server" /><br />
+         <asp:button onclick="Upload_Click" text="Upload"
+runat="server" /><br />
+         <asp:label id="result" runat="server" />
+      </form>
+   </body>
+</html>
+
+::::::::::::::
+WebForm1.aspx.cs
+::::::::::::::
+using System;
+using System.IO;
+using System.Web;
+using System.Web.SessionState;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using System.Web.UI.HtmlControls;
+
+namespace test
+{
+        public class WebForm1 : System.Web.UI.Page
+        {
+      protected HtmlInputFile upload;
+      protected Label result;
+
+      public WebForm1() {
+         this.Load += new EventHandler(Page_Load);
+      }
+
+                private void Page_Load(object sender, System.EventArgs e)
+                {
+                }
+
+      protected void Upload_Click(object sender, System.EventArgs e) {
+         StreamReader sr = new
+StreamReader(upload.PostedFile.InputStream);
+         string s = sr.ReadToEnd();
+         sr.Close();
+         result.Text = s;
+      }
+        }
+}
+
+
+Failure:
+Server error in '/' application
+
+--------------------------------------------------------------------------------
+
+Description: Error processing request. 
+Error Message: HTTP 500. 
+
+Stack Trace: System.NullReferenceException: Object reference not set
+to an instance of an object
+in <0x00029> test.WebForm1:Upload_Click (object,System.EventArgs)
+in <0x0005a> (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs
+(object,System.EventArgs)
+in <0x000a0> System.Web.UI.WebControls.Button:OnClick (System.EventArgs)
+in <0x00058>
+System.Web.UI.WebControls.Button:System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
+(string)
+in <0x00016> System.Web.UI.Page:RaisePostBackEvent
+(System.Web.UI.IPostBackEventHandler,string)
+in <0x0003e> System.Web.UI.Page:RaisePostBackEvents ()
+in <0x002b6> System.Web.UI.Page:InternalProcessRequest ()
+in <0x0008d> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
+in <0x00327> ExecuteHandlerState:Execute ()
+in <0x00084> StateMachine:ExecuteState
+(System.Web.HttpApplication/IStateHandler,bool&)
+
+ 
+Compile:
+mcs -out:bin/WebForm1.dll -r:System.dll -r:System.Web.dll
+-target:library *.cs