Hi Alan, Thanks! I'm putting this in the FAQ.
As for the longer term, I'm very keen on integration such a feature within Cactus but we have already standardized on using Jakarta Commons HttpClient. There is also the Jakarta Commons Codec project that we could use. If someone could find a solution using these frameworks, that would be great, and we could include it in Cactus 1.4 Thanks -Vincent > -----Original Message----- > From: Digital Monkey [mailto:[EMAIL PROTECTED]] > Sent: 30 May 2002 10:44 > To: [EMAIL PROTECTED] > Subject: WebRequest / multipart/form-data > > I may have a tidy solution to the multipart/form-data problem posed by > Gunnar Ole Skogen, using the HTTPClient classes from Ronald Tschal�r > (http://www.innovation.ch/java/HTTPClient/) a block of code such as > below may be used to construct a multipart test example. > > import HTTPClient.Codecs; > import HTTPClient.NVPair; > . > . > . > NVPair[] hdrs = new NVPair[1]; > > public void beginUpload(WebRequest theRequest) > { > NVPair[] opts = { new NVPair("option", "myoption") }; > NVPair[] file = { new NVPair("comment", "/home/alan/src.zip") }; > try { > byte[] data = Codecs.mpFormDataEncode(opts, file, hdrs); > InputStream i = new ByteArrayInputStream(data); > theRequest.setUserData(i); > theRequest.setContentType(hdrs[0].getValue()); > i.close(); > } catch (IOException e) { > System.out.println("Error Building Multipart"); > } > } > > If this helps anyone, please let me know - I would be happy to write up > a more detailed explanation for inclusion in the docs > > Alan Perfect > DigitalMonkey > www.digitalmonkey.co.uk > > > -- > To unsubscribe, e-mail: <mailto:cactus-user- > [EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:cactus-user- > [EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
