image upload not working
See original GitHub issueHi there,
I can’t make this snipped work
const Twitter = require('twitter-lite')
var client = new Twitter({
consumer_key: 'changed',
consumer_secret: 'changed',
access_token_key: 'changed',
access_token_secret: 'changed'
})
var data = require('fs').readFileSync('./mymedia.png')
client.post('media/upload', { media: data })
.then((err, media, res) => {
console.log(err, media, res)
})
The only thing i got is err = { errors: [ { message: 'Sorry, that page does not exist', code: 34 } ] }
Did I miss something ? I’m on a macOS with nodejs v9 and the latest version of this lib. Uploading the same image with twurl works like a charm.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
php - Image upload not working - Stack Overflow
I would consider myself an intermediate PHP programmer, but I have never used file uploads before. I have been stuck on this problem...
Read more >What is Wrong With a Computer When Your Pictures Won't ...
Close your browser window and clear your cache and cookies and reload the site. You'll join another server that may work more quickly...
Read more >6 Easy Ways to Fix Image Upload Issues in WordPress
In some cases, disabling the plugins you are using can also resolve the image upload issues. Disable all the plugins you have incorporated....
Read more >How to Quickly Fix Image Upload Issues in WordPress
2 Common WordPress Image Upload Errors and Solutions to Fix Them ; 2.1 Change File Permissions ; 2.2 Rename the Image ; 2.3...
Read more >How to Fix Image Upload Issue in WordPress (Step by Step)
If the issue is cropping up after transferring a site to a new domain this works for me: open the Settings menu, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Might be related to the fact that the media/upload endpoint is on the ‘upload’ subdomain, not the ‘api’ one.
There’s a good example of creating two clients in the test suite, while keeping it DRY. One for api endpoint, one for upload endpoint.
then you can do–