[php] Photo upload posts throw 401 Not Authorized

475 views
Skip to first unread message

Stephen Lester

unread,
May 17, 2012, 1:58:18 PM5/17/12
to tumbl...@googlegroups.com
Greetings everyone!

So here's my problem: I'm trying to let users generate an image and then upload it to an 'archive' on tumblr. I'm using the PHP code at https://gist.github.com/1649885, and it works for text posts, i.e. if I change $params to array("body" => "stuff", "type" => "text"); but when I use the code provided to try to upload an image, it throws 401 Not Authorized. So I know my access keys work at least.

A related question:
Standard (i.e. not generated by my script) JPGs uploaded fine on my Mac's Apache server, but not when I uploaded it to my host. But generated images have never worked -- does tumblr verify JPGs or is it possibly an encoding issue?

Thanks in advance,
Stephen

Stephen Lester

unread,
May 18, 2012, 9:46:12 AM5/18/12
to tumbl...@googlegroups.com
The upload started working for random instances of the uploaded images -- some of the images that I create upload fine, but others give a Not Authorized error. This error seems very bizarre and very unhelpful. I am authorized, that is obvious, so it must have something to do with the file bitstream, but I can't for the life of me figure out what problem tumblr is having.

Thanks,
Stephen

John Bunting

unread,
May 18, 2012, 9:49:22 AM5/18/12
to tumbl...@googlegroups.com
So you're using the exact example that is out on github? Have you gotten a similar error using any of the other examples? Such as the python code found here: https://gist.github.com/1389963

I'm happy to help debug the problem

-- 
John Bunting

Simplicity is a prerequisite for reliability
   --Edsger W. Dijkstra

Philipp Schlösser

unread,
May 18, 2012, 5:18:59 PM5/18/12
to tumbl...@googlegroups.com
I once ran into a similar problem. Please check my posting on this on Stackoverflow, it might help.
Reply all
Reply to author
Forward
0 new messages