最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to check if an object is of type Blob? - Stack Overflow

programmeradmin3浏览0评论

Is it possible to check if an object is of type Blob in JavaScript?

I'm getting the following error:

TypeError: Argument 1 of FileReader.readAsDataURL does not implement interface Blob.

Is it possible to check if an object is of type Blob in JavaScript?

I'm getting the following error:

TypeError: Argument 1 of FileReader.readAsDataURL does not implement interface Blob.

Share Improve this question asked May 27, 2017 at 18:14 1.21 gigawatts1.21 gigawatts 17.9k40 gold badges145 silver badges273 bronze badges 2
  • 1 take a look at stackoverflow./questions/20727750/… – Luca Kiebel Commented May 27, 2017 at 18:17
  • Thanks. None of the similar search results came up today or I would have seen it was already answered. :) – 1.21 gigawatts Commented May 27, 2017 at 18:30
Add a ment  | 

1 Answer 1

Reset to default 5

using instanceof blob you can check.

var MyBlob = new Blob(['content'], {type : 'text/plain'});
console.log(MyBlob instanceof Blob) // true
发布评论

评论列表(0)

  1. 暂无评论