Closed gavyncaldwell closed 6 years ago
What is event.target.files[0]
? If it's a file path, be sure to call fs.createReadStream
with the path and send that into the upload
function.
Take a look at the examples: https://github.com/RexMorgan/uploadcare-node/blob/master/examples/usage.js#L18
Also, make sure you're providing your public and secret keys, in your example you're only providing the public key.
Let me know if this doesn't help you.
here is my code:
uploadcare('puiblic-id').file.upload(event.target.files[0], (err, res) => { console.log(err,res) })
when i call this i get the error above! How do I fix this?