简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM