Upload multiple images to one photoset

1,287 views
Skip to first unread message

Miloshes

unread,
Jul 24, 2011, 8:15:00 PM7/24/11
to Tumblr API Discussion
Hi guys,

I would like to create a photoset through tymblr's API. I can upload
pictures separately but can't figure out how to upload them to one
photoset.

Documentation says:
data parameter

Array
(URL-encoded binary contents)

One or more image files (submit multiple times to create a slide show)

I don't know what they mean by submit multiple times..

Please help.

HoLin

unread,
Jul 25, 2011, 4:01:56 AM7/25/11
to Tumblr API Discussion
we also want to know how to do that.

Derek Gottfrid

unread,
Jul 26, 2011, 2:04:29 PM7/26/11
to tumbl...@googlegroups.com
The docs are bit unclear but need to submit the photos data attached to fields like - data[0] , data[1] - etc.  Hopefully this helps. 

d


--
api lead // tumblr

HoLin

unread,
Jul 27, 2011, 12:32:02 AM7/27/11
to Tumblr API Discussion
we have try that, but it do not work as expected, only the first
photo upload correctly. can not see the next one.

code like blow:
[asiRequest addData:data1 forKey:@"data[0]"];
[asiRequest addData:data2 forKey:@"data[1]"];

Derek Gottfrid

unread,
Jul 27, 2011, 1:03:04 PM7/27/11
to tumbl...@googlegroups.com

Ah we pushed a fix for this this morning. Can you try again? 

HoLin

unread,
Jul 27, 2011, 10:24:32 PM7/27/11
to Tumblr API Discussion
Still not work.

we use objective-c, code:

ASIFormDataRequest *request = [ASIFormDataRequest
requestWithURL:url];
...
...
[request addFile:@"/Users/holin/Desktop/ben.jpg" forKey:@"data[0]"];
[request addData:imageData withFileName:@"george.jpg"
andContentType:@"image/jpeg" forKey:@"data[1]"];


We cannot find any example code about Tumblr API usage :(

Miloshes

unread,
Jul 29, 2011, 3:47:09 PM7/29/11
to Tumblr API Discussion
Could you guys provide any working example please?

That would really help..

Milos

Victor

unread,
Sep 10, 2011, 1:05:21 AM9/10/11
to Tumblr API Discussion
I have the same question -- also, can this be done with photo urls
(make a photoset with a list of urls)? The documentation seems to
indicate no...

Derek Gottfrid

unread,
Sep 12, 2011, 10:30:48 AM9/12/11
to tumbl...@googlegroups.com
Here is a working example in python


YMMV - please feel free to fork/improve

Victor

unread,
Sep 13, 2011, 8:38:32 AM9/13/11
to Tumblr API Discussion
Thanks. Any idea how to implement this in iOS? Why can't we just post
multipart form data? See my question:
http://stackoverflow.com/questions/7400666/what-is-the-equivalent-of-pythons-file-read-in-objective-c-ios

Victor

unread,
Sep 15, 2011, 9:46:14 AM9/15/11
to Tumblr API Discussion
I think I've figured it out -- see my response to the question on
stackoverflow:
http://stackoverflow.com/questions/6878662/tumblr-api-how-to-upload-multiple-images-to-a-photoset

On Sep 13, 5:38 am, Victor <vvan...@gmail.com> wrote:
> Thanks. Any idea how to implement this in iOS?  Why can't we just post
> multipart form data? See my question:http://stackoverflow.com/questions/7400666/what-is-the-equivalent-of-...

Mahesh Asolkar

unread,
Oct 7, 2011, 3:03:24 PM10/7/11
to tumbl...@googlegroups.com
What about captions per image? Are there fields like - caption[0] , caption[1] - etc. too?

/Mahesh.

Mahesh Asolkar

unread,
Oct 8, 2011, 9:35:12 PM10/8/11
to tumbl...@googlegroups.com
Hi Derek,

I could successfully create a post with single image.

But I struggling with multiple images in a post via API too. I am including a link to the log file that has the post request that I sent to tumblr API. It has fields like data[0], data[1] as you suggested in your earlier post. However, I see that only the first image is included in the post. The second one doesn't show up. Here's the link to the post that was create by the above request (http://junkshunclicks.tumblr.com/post/11170452148/test-post).

Log file:

Any ideas where I am going wrong?

Thanks,
Mahesh.

mohacs

unread,
Nov 17, 2011, 12:04:15 PM11/17/11
to tumbl...@googlegroups.com
hi, i am using ASIFormDataRequest too i am not even able to upload one photo, any advise?

[request addData:data forKey:@"data[0]"];


it returns {"meta":{"status":401,"msg":"Not Authorized"},"response":[]}


with this 

 

[request addData:data forKey:@"data"];


{"meta":{"status":400,"msg":"Bad Request"},"response":{"errors":["Please select a photo to upload."]}}


many thanks,

Steven Pears

unread,
Nov 17, 2011, 4:03:29 PM11/17/11
to Tumblr API Discussion
The array idea didn't seem to work. Really need a sample HTTP request
body from the team

Reply all
Reply to author
Forward
0 new messages