From: <Gou...@ne...> - 2003-11-28 11:40:02
|
There is a bug in 1.3pre1 that is already known and seems to be fixed as a developer list says, but is not released yet: inputs are not submitted with the form if they are not direct children. Brad Clarke <bc...@bo...> wrote: >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. __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455 |