Facing "Unexpected API Error" in Javascript uploadFile api https://upload.io/upload-js#get-started

Viewed 23

I am trying to upload a file using javascript JavaScript File Upload Library called upload.js but my upload function is giving "Unexpected API Error". Please check the code below.

const { Upload } = require("upload-js");

const upload = new Upload({
  apiKey: "free"
});
const fileObject = new File([blob], documentName);
const { fileUrl, fileId } = await upload.uploadFile(fileObject); // this function giving error.
0 Answers
Related