instagram-web-api
instagram-web-api copied to clipboard
Getting 400 - Header Content-Length has invalid value on uploadPhoto
I have a function which uploads the photo and returns the media.code from docs.
const upload_photo = async (client, path, caption, post) => {
const { media } = await client.uploadPhoto({ photo: path, caption: caption, post: post});
return media.code;
};
When I try to upload it from this function, I get this error message:
UnhandledPromiseRejectionWarning: StatusCodeError: 400 - "{\"debug_info\":{\"retriable\":false,\"type\":\"ParameterValidationError\",\"message\":\"Header Content-Length has invalid value\"}}"
Uploading my images from a path like this: ./path/to/my/image.jpg
Tried to changing caption length, didnt work. Whats wrong? Thank you.
I got The same issue, have you fixed that? maybe?
@GamerStop Sorry for late response,
I solved it with converting the image by buffer and uploading it as a buffer (which i got it in #206).