linkfy/Tools-for-Instagram

Upload Picture Problems

Opened this issue · 2 comments

I'm trying to upload a picture with the following code;

var picturePath = path.basename('/home/ubuntu/Tools-for-Instagram/IGPost_01.png');
let caption = "This is a test image that I'll delete in a few seconds";
var namesToTag = [];

try {
await uploadPicture(ig, caption, myPicturePath, namesToTag);
}catch (error) {
console.log("Error could post image to Instagram: " + error.message);
}

Error:
Error could post image to Instagram: POST /rupload_igphoto/1606853056495_0_6880353997 - 400 Bad Request;

Using uploadPictureByURL

let pictureUrl = "https://www.website.com/storage/app/media/postImages/IGPostImage_01.png";
let caption = "This is a test image that I'll delete in a few seconds";

try {
    console.log("trying to post an image");
    await uploadPictureByUrl(ig, caption, pictureUrl);
} catch(error) {
    console.log("Error could post image to Instagram: " + error.message);
}

Error:
IgResponseError: POST /rupload_igphoto/1606852939576_0_7864407481 - 400 Bad Request;

Any ideas on what could be happening?

same thing.. any suggestions?

You're uploading a .png, only JPG files are supported.