Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular Base64 file upload as JSON

I'm trying to create a reusable directive in my app that allows for files to be encoded as base64 then uploaded via JSON.

I haven't seen my resources on the web talking about this approach. I've mostly only been able to find Angular file uploads via form data.

Can anyone shed some light on this topic?

like image 659
Mike Fisher Avatar asked Nov 02 '22 00:11

Mike Fisher


1 Answers

This link may prove interesting. Basically he state that Base64 encoded data is 33% larger and takes longer to process than binary.

htmltrocks has an interesting article regarding integrating the canvas element into your App. It shows use of the HTML5 canvas toDataURL() method which converts to Base64.

See also: How to convert image into base64 string using javascript

like image 105
Mick Cullen Avatar answered Nov 11 '22 02:11

Mick Cullen