Thanks Lien.

I was able to get this figured out.  It was a problem with the way I
was encoding the image data.  I needed to be using iso-8859-1.
I really appreciate your help

On Dec 8, 5:00 pm, Sean <[EMAIL PROTECTED]> wrote:
> Thanks Lien,
>
> I am trying to get this done using c#.NET and I think I am getting
> closer.  What is happening with my request is it is getting truncated
> only a few characters in to the actualimagedata so I don't have a
> footer boundary.  The post completes successfully, but theimagethat
> gets uploaded to the server isn't formatted correctly.
>
> Here is the full request body -
> POST /account/update_profile_image.xml HTTP/1.1
>
> Content-Type: multipart/form-data;
> boundary=125e2d3d-97d3-44fc-8267-9a8ef2d79644
>
> Authorization: Basic <removed>
>
> Host: twitter.com
>
> Content-Length: 201010
>
> Expect: 100-continue
>
> --125e2d3d-97d3-44fc-8267-9a8ef2d79644
>
> Content-Disposition: form-data; name="image"; filename="seantest.jpg"
>
> Content-Type:image/jpeg
>
> ÿØÿà
>
> Any ideas what could be causing theimagedata to be truncated?
> Thanks again for your help
>
> On Dec 8, 3:24 pm, Lien Tran <[EMAIL PROTECTED]> wrote:
>
>
>
> > Here's what my request body looks like:
>
> > POST /account/update_profile_image.xml HTTP/1.1
> > Authorization: Basic <removed>
> > Content-Type: multipart/form-data;
> > boundary=-----------------------------1228771270538
> > User-Agent: Java/1.6.0_02
> > Host: twitter.com
> > Accept: text/html,image/gif,image/jpeg, *; q=.2, */*; q=.2
> > Connection: keep-alive
> > Content-Length: 71380
>
> > -------------------------------1228771270538
> > Content-Disposition: form-data; name="image"; filename="Sunset.jpg"
> > Content-Type:image/jpeg
>
> > <binary data here>
> > -------------------------------1228771270538--HTTP/1.1 200 OK
>
> > On Dec 8, 8:11 am, Sean <[EMAIL PROTECTED]> wrote:
>
> > > Would you mind posting a sample of your correctly formatted request
> > > here?  I  am running windows and haven't been able to get curl up and
> > > running yet.
>
> > > Thanks
>
> > > Sean
>
> > > On Dec 8, 12:06 am, Lien Tran <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks Alex.  I used curl to see what the request should look like and
> > > > then coded up my request accordingly.  It's working for me now.
>
> > > > On Dec 6, 11:37 am, "Alex Payne" <[EMAIL PROTECTED]> wrote:
>
> > > > > The test we use for this method is to use curl:
>
> > > > > curl -F '[EMAIL PROTECTED]/to/test/image.jpg' -u 
> > > > > USERNAME:PASSWORDhttp://twitter.com/account/update_profile_image.xml
>
> > > > > If you use an HTTP proxy, you can see it generating the appropriate
> > > > > request and response.
>
> > > > > On Sat, Dec 6, 2008 at 00:09, Lien Tran <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello,
>
> > > > > > I've been trying to update myprofileimageusing the account method
> > > > > > update_profile_image.  However, the server keeps returning the error
> > > > > > "There was a problem with your picture. Probably too big."  The 
> > > > > > photo
> > > > > > I am trying touploadis a jpg less than 700 kilobytes in size.  Below
> > > > > > is the request body and request response.
>
> > > > > > Request body:
> > > > > > POST /account/update_profile_image.xml HTTP/1.1
> > > > > > Authorization: Basic <encoded credentials here>
> > > > > > User-Agent: Jakarta Commons-HttpClient/3.1
> > > > > > Host: twitter.com
> > > > > > Content-Length: 71440
> > > > > > Content-Type: multipart/form-data; boundary=tUGDGHg6-
> > > > > > mbUEjVXYFhFWeb_NFmBUxiXOK
>
> > > > > > --tUGDGHg6-mbUEjVXYFhFWeb_NFmBUxiXOK
> > > > > > Content-Disposition: form-data; name="Sunset.jpg";
> > > > > > filename="Sunset.jpg"
> > > > > > Content-Type: application/octet-stream; charset=ISO-8859-1
> > > > > > Content-Transfer-Encoding: binary
>
> > > > > > <binary data here>
>
> > > > > > --tUGDGHg6-mbUEjVXYFhFWeb_NFmBUxiXOK--
>
> > > > > > Response body:
> > > > > > HTTP/1.1 403 Forbidden
> > > > > > Date: Sat, 06 Dec 2008 07:59:53 GMT
> > > > > > Server: hi
> > > > > > Last-Modified: Sat, 06 Dec 2008 07:59:53 GMT
> > > > > > Status: 403 Forbidden
> > > > > > Pragma: no-cache
> > > > > > Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, 
> > > > > > post-
> > > > > > check=0
> > > > > > Content-Type: application/xml; charset=utf-8
> > > > > > Content-Length: 183
> > > > > > Expires: Tue, 31 Mar 1981 05:00:00 GMT
> > > > > > Set-Cookie:
> > > > > > _twitter_sess=BAh7BzoHaWQiJWRhOWNmNjI1MGM5MjRmYWIwOGEzOGQwNTQyYzNmZTNjIgpm
> > > > > > %250AbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpGbGFzaDo6Rmxhc2hIYXNoewAG
> > > > > > %250AOgpAdXNlZHsA--d9fe4dcadf2064553d3371c9fe767ff009f20c21;
> > > > > > domain=.twitter.com; path=/
> > > > > > Vary: Accept-Encoding
> > > > > > Connection: close
>
> > > > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > > > <hash>
> > > > > >  <request>/account/update_profile_image.xml</request>
> > > > > >  <error>There was a problem with your picture. Probably too big.</
> > > > > > error>
> > > > > > </hash>
>
> > > > > > Does the request body look correct?  Does anyone have a sample of 
> > > > > > what
> > > > > > the request body should look like if this is not correct?
>
> > > > > > Thanks.
>
> > > > > --
> > > > > Alex Payne - API Lead, Twitter, 
> > > > > Inc.http://twitter.com/al3x-Hidequotedtext -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Reply via email to