Yong,
You should be using PostMethod.setRequestBody(InputStream) method to provide the
request content body (as Mike pointed out) and wrap the source InputStream with a
FilterInputStream. Exactly what you choose to do in the FilterInputStream is up to
you. One possibility is to file events
:
this.listeners.invokeListeners?
Thanks,
Yong Chen
-Original Message-
From: Kalnichevski, Oleg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 12:46 AM
To: Commons HttpClient Project
Subject: RE: file upload (PUT method) progress report
Yong,
You should be using
Hi Yong,
1. I'm actually using putmethod, not postmethod, but I assume your
suggest applies to putmethod too, is it correct?
Yes, the same thing will work for both methods.
2. Since my put will put (upload) a local file onto server, so I
think ProgressInputStream will take a FileInputStream as
That's great, thanks a lot Mike.
Yong Chen
-Original Message-
From: Michael Becke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 4:34 PM
To: Commons HttpClient Project
Subject: Re: file upload (PUT method) progress report
Hi Yong,
1. I'm actually using putmethod
Hi Yong,
The only way to get progress at the moment is to track the reads on the
InputStream given to PostMethod.setRequestBody(InputStream).
Mike
On Nov 10, 2003, at 7:02 PM, Yong Chen wrote:
Hi,
I'm using putmethod to put (large size) file on server. After calling
executeMethod(), I
Jay,
The only solution that I can think of is to get hold of HttpClient source code and
extend it with a feedback mechanism of your liking. We, HttpClient developers, may
consider adding events in 2.1 or 3.0 release as a standard feature. For the time
being, a HttpClient fork appears your only
I think it's easier to create a custom FilePartSource implementation
which creates the events or can be polled by your application.
Odi
Kalnichevski, Oleg wrote:
Jay, The only solution that I can think of is to get hold of
HttpClient source code and extend it with a feedback mechanism of
your
Yes, this is how I have used it in the past. I wrapped the InputStream
to be returned from PartSource.createInputStream() in a class that
counted the number of bytes read and periodically fired an event.
Mike
On Tuesday, June 10, 2003, at 04:13 AM, Ortwin Glück wrote:
I think it's easier to
Daniel Walsh wrote:
I was under the impression, though, that the implementation that you spoke
of would require an HTML form, or some other type of UI - which my
application does not use. Is that not true?
No of course not. HttpClient provides all you need to tailor an
appropriate POST
Daniel,
While others have provide you with alternative suggestions to pursue, I
had one additional thought. If all you are interested in sending is the
file name, you should be able to extract that from the HTTP PUT request
itself - unless of course you want the file name to put to be
The usual mechanism for uploading files is to use the POST method with an
encoding type of multipart/form-data. HttpClient will help you with
sending the data this way, and Commons FileUpload will help you with
accessing it from within your servlet.
--
Martin Cooper
-Original Message-
Thanks for responding so quickly Martin.
I was under the impression, though, that the implementation that you spoke
of would require an HTML form, or some other type of UI - which my
application does not use. Is that not true?
Daniel
The usual mechanism for uploading files is to use the POST
12 matches
Mail list logo