hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Having trouble with MultipartRequestEntity
Date Wed, 17 Aug 2005 05:29:16 GMT
Hi Trudy,

> I am attempting to use the MultipartRequestEntity to upload a file and
> some additional parameters via HTTP to a client.  The process works fine

How do you upload to a *client*? HttpClient is the client, the other side
of the communication needs to be an HTTP server. HTTP is not a peer-2-peer
protocol where clients can communicate with eachother.

> if I am sending to another Java client, but I am getting some additional
> text on all the string parameters when sending to non-Java clients (ASP,
> Perl etc).  I am getting "Content-Transfer-Encoding: 8bit" appended to
> the beginning of each parameter value.  I have confirmed that this does

That part header is specified by RFC 1521. I assume that your ASP, Perl
and other environments just don't implement that standard (correctly),
while the Java environment does.

> not happen if I submit the file using a standard HTTP page.  The problem
> also does not occur if I am just using the PostMethod without sending
> file data.  I am using the latest release of HTTPClient.

That's strange, since the StringPart use Content-Transfer-Encoding: 8bit,
while the file parts use C-T-E: binary by default. Maybe your non-Java
environments can't handle different C-T-Es in a single request?

Try PartBase.setTransferEncoding(null) on the string and file parts. This
should prevent the C-T-E headers from being sent.

hope that helps,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message