RE: File Upload Problem

<[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <652366DEEF97A3438EC2F4669BD66BA58A7977@msgswbmnmsp31.wellsfargo.com>
Kaleem,

Try replacing:
 request = formName.getRequest("Send");
 response = wc.getResponse( request );

with:
 response = formName.submit();

I think your code may be doing a GET rather than a POST.

 - George Dinwiddie
   http://www.idiacomputing.com/



> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of [email protected]
> Sent: Tuesday, April 18, 2006 4:51 AM
> To: [email protected]
> Subject: [Httpunit-develop] File Upload Problem
> 
> 
> 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
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop


-------------------------------------------------------
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&kid0944&bid$1720&dat1642
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.