filestack / filestack-js

Official Javascript SDK for the Filestack API and content ingestion system.
https://www.filestack.com
MIT License
206 stars 76 forks source link

Getting "Invalid upload params" when uploading a file with filename param #421

Closed faaizalikhan1 closed 3 years ago

faaizalikhan1 commented 3 years ago

Hi! I am trying to upload a file with filename param, but getting the above error, this is my code:

await fsclient.upload(data, { filename: 'test.webp' });

it works fine when I don't have the filename param, data is the image buffer.

pcholuj commented 3 years ago

Yup because you need to pass filename param as store options, not upload options so check await fsclient.upload(data, {}, { filename: 'test.webp' });