On 6/21/2014 10:52 AM, Dung Nguyen wrote:
hmm, seem something wrong... i had log the data and upload here :
https://www.dropbox.com/sh/g5nqod16tic7gdb/AADb17Klw0vXFux7iX8HGlhGa
if curl sent exactly the post field then maybe i did sent wrong format
to flickr
2014-06-21 19:31 GMT+07:00 Daniel Stenberg <[email protected]
<mailto:[email protected]>>:
On Sat, 21 Jun 2014, Dung Nguyen wrote:
i write a small application to upload to flickr i jz handle
"multipart/form-data" post data my self and give to curl via
CURLOPT_POSTFIELDS
however when post flickr always return <err code="4"
msg="Filesize was
zero" />
Then you probably didn't format the data the way the receiver
expected it.
Have you read the upload api:
https://www.flickr.com/services/api/upload.api.html
Also you can try a web debugging proxy like fiddler so you can see what
is sent to flickr. For example I just tried a browser upload in Firefox
and here is what was sent:
POST https://up.flickr.com/services/upload/ HTTP/1.1
[Other headers]
-----------------------------3592247124213
Content-Disposition: form-data; name="batch_id"
23
-----------------------------3592247124213
Content-Disposition: form-data; name="async"
1
-----------------------------3592247124213
Content-Disposition: form-data; name="api_key"
[Key]
-----------------------------3592247124213
Content-Disposition: form-data; name="auth_hash"
[Hash]
-----------------------------3592247124213
Content-Disposition: form-data; name="chronic_rehab"
1
-----------------------------3592247124213
Content-Disposition: form-data; name="is_family"
0
-----------------------------3592247124213
Content-Disposition: form-data; name="is_friend"
0
-----------------------------3592247124213
Content-Disposition: form-data; name="is_public"
0
-----------------------------3592247124213
Content-Disposition: form-data; name="file_number"
1
-----------------------------3592247124213
Content-Disposition: form-data; name="photo"; filename="Filename.jpg"
Content-Type: image/jpeg
[JPEG data]
-----------------------------3592247124213
Content-Disposition: form-data; name="safety_level"
1
-----------------------------3592247124213
Content-Disposition: form-data; name="content_type"
1
-----------------------------3592247124213
Content-Disposition: form-data; name="hidden"
1
-----------------------------3592247124213--
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html