That sounds good to me :)
Yes, HttpClient is and should be the only client.
Thanks a lot for your help.
Bastian
> Hello Bastian,
>
> > FilePart fPart = new FilePart(file.getName(), file);
> > StringPart sPart = new StringPart("MESSAGE", "UPLOAD");
> > Part[] parts = {sPart, fPart};
> >
> > postMethod.setRequestEntity(
> > new MultipartRequestEntity(parts, postMethod.getParams()));
> >
> > The servlet use org.apache.commons.fileupload to parse the files.
> > The usual way to get a message is not working with StringPart anymore
> >
> > request.getParameter("MESSAGE");
> >
> > I only found a solution like
> >
> > if(reqeust.getContenetType().equals( "multipart/form-data"))
> > // parse all form data from the upload and get the message
>
> That is correct. If you send multipart form data, you need
> to get the parameter values from the parsed multipart data.
> If the Servlet API would support multipart form data, the
> audience for commons-fileupload would be smaller, I guess :-)
>
> There is one trick which you can _only_ use if the HttpClient
> application is and will be the only client for your servlet.
> In that case, you can send the string parameter as a query
> string in the URL and use a FileRequestEntity instead of a
> multipart request entity. Then you don't need fileupload on
> the server, but the format is not compatible with browsers.
>
> > some logs without setting anything
>
> These look fine.
>
> > if I am add setContentChuck(true)it is a bit better
>
> These look fine, too. The only difference is that chunked
> encoding will buffer the data on the client side and send
> it out in bigger chunks. Hence you get fewer log messages.
>
> > maybe there is a better way to transfer a message to let the
> > server know an upload is comming? I am new in this stuff.
>
> What about encoding it in the URL?
> http://my.server.name/path/to/servlet/upload
>
> cheers,
> Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]