filestack / filestack-js

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

"1 Unexpected EOF" error on uploading specific image #499

Open yataras opened 1 year ago

yataras commented 1 year ago

Expected Behavior

The error message should occur on the browser's view. An image should not be uploaded.

Current Behavior

The error message occurs on the browser's dev tools. An image is uploaded.

Possible Solution

It would be better to cancel uploading corrupted images. In such case, onFileUploadFailed callback could be triggered. Or there should be some additional way to catch such errors.

Steps to Reproduce

  1. Download the corrupted photo from here.
  2. Go to https://jsfiddle.net/q7supnwa/3, click Select Files to Upload and chose uploaded in the previous step picture, and click upload.
  3. Open console in devtools and there should be an error.

Additional Screenshots

  1. Error in devtools console
  2. Place in the code where the error is thrown.

Context

An issue with ignoring corrupted files causes another problem in further steps when we try to read that file. When you update image via filestack's filepicker without any change and re-upload it, everything works fine.

Your Environment