File Upload Problem

[email protected]
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <B1E15CDA2AC1B7418A4E97774F82B19520CD93BE@CHICEXCHMA>
Hi,

I have a form

<FORM name=formName ACTION=""  onsubmit='return fun();'
target="javascript:new window('toolbar=no, location=no,
directories=no,scrollbars=no, status=yes, width=100, height=100');"
METHOD=POST>

<INPUT NAME="file" TYPE="file" onkeypress="return false;">
<input ...................
<input type="submit" name="Send">

</FORM>

When I am trying to upload a file(by setting the form's file Paramater and
then submitting the form) using HTTPUNIT

formName.setParameter("file",new File("D/example.java"));
request = formName.getRequest("Send");
response = wc.getResponse( request );

an error is displayed saying "java.lang.RuntimeException: May not URL-encode
a file upload request"

Please help me why am I getting this error and what should I modify in the
HTTPUNIT Code to avoid this error.

Thanks,
Kaleem

-----------------------------------------
This message and any attachments are intended only for the use of
the addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended
recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this
communication in error, notify the sender immediately by return
email and delete the message and any attachments from your system.




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.