Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting error 417 from Twitter on image upload #9

Open
adamzwakk opened this issue Nov 21, 2012 · 3 comments
Open

Keep getting error 417 from Twitter on image upload #9

adamzwakk opened this issue Nov 21, 2012 · 3 comments
Assignees
Labels
Milestone

Comments

@adamzwakk
Copy link

I'm trying to upload an image and status to Twitter, but the response I get back is 417 and nothing gets posted.

My code is this

$args['status'] = $status;
$args['media[]'] = '@'.$_FILES['image']['tmp_name'].';type='.$_FILES['image']['type'].';filename='.$_FILES['image']['name'];
$code = $tmhOAuth->request('POST', 'https://upload.twitter.com/1/statuses/update_with_media.json', $args,false,true);

I've seen some other issues like this (like this one http://www.lampdocs.com/blog/2011/06/twitter-error-417-expectation-failed-php-solution/) but I can't seem to get around it.

Any ideas?

@adamzwakk
Copy link
Author

I added $this->headers['Expect'] = ''; to line 359 in tmhoauth.php and it worked for me.

@jefvlamings
Copy link

The addition of empty expect headers solved the failing image upload issue for me too.

@themattharris
Copy link
Owner

so the problem with an empty expects header is it's fundamentally against the RFCs - which is why I took it out. it's also not required, from my testing, for v1.1 of the Twitter API.

i'll try and spend some time this christmas finding an RFC compatible way of making this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants