H,
Can you confirm if you are passing the encoded contents of the file as part of the POST request?
Ideally external libraries if used takes care of forming this but if you are doing this manually then try setting the boundary and pass the base64 encoded file contents along with the request as shown below.
For e.g.
POST /ya/upload
Content-Length: 32731
Content-Type: multipart/form-data; boundary=---------------------------7da34b1d80888
Cookie: B=27l1d2t534pjd&b=4&d=J0o0cAxpYEKrWNxzrCEOkvwSdFWXs8UBh_d.KQ--&s=ug&i=wgmj2zTKifIKcTQIdcFh;
^@<F9><BC>KD6^N^@<DC>^E^@^@<EA>^E^@^@^@^^^K<D5>F^Z^@^R<F2>l*^@^H^@E^@^E<DC>90@^@?^F,^Wb<89>ESC{C<C3>^O^NP^P^@P<F4><B5><D3>sH<AD>0|<80>^P<82>^X$:^@^@^A^A^H
<89><98>x^G<F3><C4><91><CE>-----------------------------7da34b1d80888
Content-Disposition: form-data; name="_charset_"
utf-8
-----------------------------7da34b1d80888
Content-Disposition: form-data; name="uploadfile"; filename="C:\Users\Ma\<C3><A0>.xls"
Content-Type: application/vnd.ms-excel
<D0><CF>^Q<E0><A1><B1>^Z<E1>^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@>^@^C^@<FE><FF> ^@^F^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@<^@^@^@^@^@^@^@^@^P^@^@<FE><FF><FF><FF>^@^@^@^@<FE><FF><FF><FF>^@^@^@^@;^@^@^@<FF><FF><FF>F><FF><FF> ^P^@^@^F^E^@<AF>^X<CD>^G<C9><C0>^@^@^F^A^@^@<E1>^@^B^@<B0>^D<C1>^@^B^@^@^@<E2>^@^@^@\^@p^@^E^@^@Ma
--R
POST http://mail.yahooapis.com/ya/upload
authorization: OAuth realm="yahooapis.com",oauth_nonce="1270894703203",oauth_consumer_key="[apiKey]",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1270894703",oauth_version="1.0",oauth_signature="5cTjeOr3msW7QBsCRr%2F6ZQb9t%2FI%3D",oauth_session_handle="[sessionHandle]",oauth_token="[token]"
content-length: 39
user-agent: Jakarta Commons-HttpClient/3.1
content-type: application/x-www-form-urlencoded
POST PARAMETERS
output=json
uploadfile=C:/blow.txt
I tried again by changing the content type to "text/plain". Though it didn't gave the previous error, it now gave a different error:
<?xml version="1.0" encoding="UTF-8"?>
<Error>uploadFileSizeError</Error>
<!-- web53206.mail.re2.yahoo.com uncompressed/chunked Sat Apr 10 03:30:53 PDT 2010 -->
how could it be uploadFileSize error, it's a damn small file.
Please tell what's the error in the request.
Thanks