You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Danny Gallagher <da...@generatedsystems.com> on 2009/06/12 14:52:02 UTC

Upload file - multipart

I am attempting to upload a file to a server, using HttpClient to talk
to

the server application.

 

The user I am logging in with is able to successfully upload a file
through a browser.

 

When I attempt the same request in my application code, the server
returns a 500 error.

I don't have access to the server, so I cannot look at the logs to see
what causes the 500.

In my application code.  

 

In my application, I get logged in, receive the proper cookies from the
server, etc.

My file upload request and the one sent through the browser are the
same, or very similar, as far as I can tell.

I searched the mail list archives for file upload and tried the
suggestions that I found there to no avail.

 

Here are the logs from both my application and the browser application,
as it relates to the file upload post.

Any help is much appreciated.

 

Thanks,

 

Danny

 

 


Re: Upload file - multipart

Posted by Oleg Kalnichevski <ol...@apache.org>.
Danny Gallagher wrote:
> Strange, it would not let me post the message with the logs in the body.
> Bounced back as exceeding spam threshold. Do I post them as attachments?
> 
> -----Original Message-----
> From: Danny Gallagher [mailto:danny.gallagher@generatedsystems.com] 
> Sent: Friday, June 12, 2009 8:52 AM
> To: httpclient-users@hc.apache.org
> Subject: Upload file - multipart
> 
> I am attempting to upload a file to a server, using HttpClient to talk
> to
> 
> the server application.
> 
>  
> 
> The user I am logging in with is able to successfully upload a file
> through a browser.
> 
>  
> 
> When I attempt the same request in my application code, the server
> returns a 500 error.
> 
> I don't have access to the server, so I cannot look at the logs to see
> what causes the 500.
> 
> In my application code.  
> 
>  
> 
> In my application, I get logged in, receive the proper cookies from the
> server, etc.
> 
> My file upload request and the one sent through the browser are the
> same, or very similar, as far as I can tell.
> 
> I searched the mail list archives for file upload and tried the
> suggestions that I found there to no avail.
> 
>  
> 
> Here are the logs from both my application and the browser application,
> as it relates to the file upload post.
> 
> Any help is much appreciated.
> 
>  
> 
> Thanks,
> 
>  
> 
> Danny
> 
>  

Hi Danny

The server application may not like the Content-Type header sent by 
HttpClient.

I recommend upgrading to HttpClient 4.0, which provides a much better 
support for multipart content including a browser compatibility mode.

Hope this helps

Oleg

> 
>  
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org


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


RE: Upload file - multipart

Posted by Danny Gallagher <da...@generatedsystems.com>.
Strange, it would not let me post the message with the logs in the body.
Bounced back as exceeding spam threshold. Do I post them as attachments?

-----Original Message-----
From: Danny Gallagher [mailto:danny.gallagher@generatedsystems.com] 
Sent: Friday, June 12, 2009 8:52 AM
To: httpclient-users@hc.apache.org
Subject: Upload file - multipart

I am attempting to upload a file to a server, using HttpClient to talk
to

the server application.

 

The user I am logging in with is able to successfully upload a file
through a browser.

 

When I attempt the same request in my application code, the server
returns a 500 error.

I don't have access to the server, so I cannot look at the logs to see
what causes the 500.

In my application code.  

 

In my application, I get logged in, receive the proper cookies from the
server, etc.

My file upload request and the one sent through the browser are the
same, or very similar, as far as I can tell.

I searched the mail list archives for file upload and tried the
suggestions that I found there to no avail.

 

Here are the logs from both my application and the browser application,
as it relates to the file upload post.

Any help is much appreciated.

 

Thanks,

 

Danny