Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does HTML 5's BlobBuilder() still work in Google Chrome?

Based in this article http://cloudevils.wordpress.com/2012/10/18/ajax-file-upload-without-post-using-html5/ I created a form to upload files. Initially works fine in chrome but now is not workin more. In FF work fine. I made some debugs and this line

var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();

seems stop working in chrome. Browsering around I find some info about BlobBuilder() function that is not supported more in chrome.

Can help me?

like image 455
user2011958 Avatar asked Jan 25 '13 18:01

user2011958


1 Answers

It's gone or deprecated. Use the new Blob constructor.

Read: http://updates.html5rocks.com/2012/06/Don-t-Build-Blobs-Construct-Them

In your tutorial instead of:

var bb = new (window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder)();
bb.append(data);
var blob = bb.getBlob();

Do:

var blob = new Blob([data]);
like image 150
Adam Avatar answered Oct 03 '22 22:10

Adam