[Mono-bugs] [Bug 56080][Wis] New - Bad content in HttpPostedFile.InputStream (and HttpPostedFile.SaveAs())

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 26 Mar 2004 12:11:01 -0500 (EST)


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 mono-bug@jerryweb.info.

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

--- shadow/56080	2004-03-26 12:11:01.000000000 -0500
+++ shadow/56080.tmp.26320	2004-03-26 12:11:01.000000000 -0500
@@ -0,0 +1,73 @@
+Bug#: 56080
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mono-bug@jerryweb.info               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Bad content in HttpPostedFile.InputStream (and HttpPostedFile.SaveAs())
+
+Description of Problem:
+Bad content in HttpPostedFile.InputStream (and HttpPostedFile.SaveAs())
+
+Steps to reproduce the problem:
+Send text file via this ASP.NET page:
+
+===============================================================
+<%@ Page Language="C#" %>
+<%@ Import namespace="System.IO" %>
+<html>
+<body>
+<%
+if(Request.HttpMethod.ToLower() == "post") {
+%>
+<pre>
+---------------------------- Start -----------------------------
+<%
+	HttpPostedFile file = Request.Files["file"];
+	if(file.ContentLength > 0) {
+		StreamReader sr = new StreamReader(file.InputStream);
+		Response.Write(sr.ReadToEnd());
+	}
+%>
+----------------------------  End  -----------------------------
+</pre>
+<% } else { %>
+<form method="post" enctype="multipart/form-data">
+<input type="file" name="file" /><br />
+<input type="submit" value="Submit">
+</form>
+<% } %>
+
+</body>
+</html>
+===============================================================
+
+
+MS.NET 1.0:
+---------------------------- Start -----------------------------
+hello world...;-)
+
+----------------------------  End  -----------------------------
+
+
+Mono 0.31, Gentoo Linux:
+---------------------------- Start -----------------------------
+-----------------------------7d4126264060304
+Content-Disposition: form-data; name="file"; filename="C:\test.txt"
+Content-Type: text/plain
+
+hello world...;-)
+
+-----------------------------7d4126264060304--
+
+----------------------------  End  -----------------------------