From: Steven A. <st...@at...> - 2003-11-26 02:05:29
|
Hi How does one / can one simulate the mime-encoding necessary to upload a file using an HtmlFileInput? I am trying to use 1.3pre1 to successfully do a mime-encoded post of a form having a <input type="file" name="foo"> HtmlFileInput (fi) element. I am assuming that if I write code like: HtmlFileInput fi = (HtmlFileInput) form.getAllInputsByName("foo")[0]; fi.setValueAttribute("/some/path/to/a/real/file"); ..... form.submit("submit button name"); that the "foo" parameter would be encoded and sent to the servlet. I understand this was just added, so I want to make sure I am doing things the right way here. It appears that the "foo" file input is not a submittable element (See HtmlForm.isSubmittable()), so it is not getting sent in the post request attributes....) Can someone suggest a way to simulate a file upload using HtmlUnit? Thanks, Steve Atkinson |