Re: Multipart file upload in applet
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Fri, 18 Jul 2008 18:15:24 -0400
Kevin McMurtrie wrote:
In article <487fd6c5$0$90263$14726298@xxxxxxxxxxxxxxx>,
Arne Vajhøj <arne@xxxxxxxxxx> wrote:
Kenneth P. Turvey wrote:I'm having some difficulty getting file upload to work. I'm using some sample code of questionable utility and I was hoping someone here could give me a hand.Use the Apache HttpClient package, classes HttpClient, PostMethod
The basic problem is that I need to post to a servlet an image and some associated metadata. It should look just like it does when it is posted by the following web page:
<html> <head> <title>Image Uploader</title> </head> <body> <form method="POST" enctype="multipart/form-data" action="http://www.squeakydolphin.com/ImageUpload/ImageUpload">
Category<input type="text" name="Category" /><br/>
UserId<input type="text" name="UserId" /><br/>
Image<input type="file" name="Image" /><br/>
<input type="submit" />
</form>
</body>
</html>
It is accepted as multipart data on the server end and that works fine. I just can't seem to get the client to produce the write output. Is there a class library I can use to ease getting this correct?
and MultipartRequestEntity !
Or build the POST manually and use Sun's Http code. It's not that hard to stick a file inside a template.
Using Apache libraries in an Applet could really drive up bandwidth costs for some uses.
My old version of HttpClient is only 225 KB. That is not much today.
And it can actually be a bit tricky to implement POST multipart
100% correct. It is easy to write something that works with some
forgiving server, but to get it to work with a strict server
requires either some standards reading or some sniffing.
Arne
.
- References:
- Multipart file upload in applet
- From: Kenneth P. Turvey
- Re: Multipart file upload in applet
- From: Arne Vajhøj
- Re: Multipart file upload in applet
- From: Kevin McMurtrie
- Multipart file upload in applet
- Prev by Date: Re: Multipart file upload in applet
- Next by Date: Re: Applet and Javascript
- Previous by thread: Re: Multipart file upload in applet
- Next by thread: Logger.getLogger question
- Index(es):
Relevant Pages
|