Frank, thanks for replying.  I believe the problem is in
MockHttpServletRequest.buildRequest().  It takes the binary data out of the
file and puts it into a String.  This does an implicit decoding of the bytes
based on the platform's default encoding (Cp1252 in Windows) and will cause
corruption when you write the data out again (input != output).

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#String(byte[],%20int,%20int)
https://issues.apache.org/jira/browse/WICKET-807

In general, I believe you should be building the request as a byte array,
not a String.

mike


Frank Bille-2 wrote:
> 
> 
> Sounds weird. I didn't actually test it with a binary file back when I did
> this. Can I get you to open an issue[1] and perhaps actually append a
> testcase patch for FormTesterTest[2], which shows that it fails?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Uploading-binary-files-via-MockHttpServletRequest-tf4192893.html#a11935269
Sent from the Wicket - User (OLD) mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
IMPORTANT NOTICE:

This mailing list is shutting down. Please subscribe to the Apache Wicket user 
list. Send a message to: "users-subscribe at wicket.apache.org" and follow the 
instructions.
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to