[Mono-bugs] [Bug 554817] New: WebClient.UploadFile sends faulty boundary

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 12 03:24:11 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=554817


           Summary: WebClient.UploadFile sends faulty boundary
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: peter.hagstrom at minovi.se
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.9.1.4)
Gecko/20091028 Ubuntu/9.10 (karmic) Firefox/3.5.4

When WebClient is used to transmit files it does not follow RFC1341 (7.2.1
Multipart), which clearly states that:

 "The encapsulation boundary following the last body part is a distinguished
delimiter that indicates that no further body parts will follow. Such a
delimiter is identical to the previous delimiters, with the addition of two
more hyphens at the end of the line"

However System.Net.WebClient fails to do so. 

Reproducible: Always

Steps to Reproduce:
WebClient client = new WebClient();
byte[] responseArray = client.UploadFile(url,filename);

Actual Results:  
POST /UploadServlet/doUpload?id=1&ticket=83594a41-91e9-447a-a948-57e06d49fd3a
HTTP/1.1
Content-Type: multipart/form-data; boundary=------------8cc31018258396c
Content-Length: 1717
Expect: 100-continue
Connection: keep-alive
Host: 192.168.128.158:8080
--------------8cc31018258396c
Content-Disposition: form-data; name="file"; filename="SeticTutorial.exe.mdb"
Content-Type: application/octet-stream
 block of data
--------------8cc31018258396c

Expected Results:  
POST /UploadServlet/doUpload?id=1&ticket=83594a41-91e9-447a-a948-57e06d49fd3a
HTTP/1.1
Content-Type: multipart/form-data; boundary=------------8cc31018258396c
Content-Length: 1717
Expect: 100-continue
Connection: keep-alive
Host: 192.168.128.158:8080
--------------8cc31018258396c
Content-Disposition: form-data; name="file"; filename="SeticTutorial.exe.mdb"
Content-Type: application/octet-stream
 block of data
--------------8cc31018258396c--

The faulty code is on line 661 in
http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/System/System.Net/WebClient.cs

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list