I am not sure it\'s even possible but - can I get the image file size from data URI?
For example, let\'s say there is an IMG element where src goes:
src
If you want file size, simply decode your base64 string and check the length.
var src ="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP/// yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; var base64str = src.substr(22); var decoded = atob(base64str); console.log("FileSize: " + decoded.length);