From: Brad C. <bc...@bo...> - 2003-11-26 15:43:23
|
At 08:05 PM 11/25/2003, you wrote: >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. As long as the content-type of the form is multipart/form-data this should work fine >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....) HtmlForm.isSubmittable() says that any inputs not of type "radio", "image", "checkbox", or "submit" is a submittable element. Brad C |