In this blog, we will discuss quick introduction of Blobs in javascript :
Blobs is bascially a chuck of bytes which can holds data of a file.It represents as the central data exchange format for a variety of new binary data API's.The name inherits from SQL databases which means "Binary Large Object".As it represents binary data and it can be large but neither is required as it could also specify the content of an small text file.
A Client side javascript object is a subtype of Blob i.e a File is just a Blob of data with name and modification date.It is an immutable objects which represents raw data.
var blob = new Blob();
console.log(blob.size);
console.log(blob.type);
Blobs actually allows you to construct file like objects that can be passed to API's which expects URL instead of providing the file by server.
Like for an example, you can construct a blob which contains data for an image via URL.createObjectURL() which generates an URL and the same will send to HTMLImageElement.src which displays we created.
Thanks
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Ankit Uniyal
Ankit has knowledge in Javascript, NodeJS, AngularJS and MongoDB also have experience in using AWS Services.