My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Angular 2 / Javascript : Best way to send image to server

nicolasb's photo
nicolasb
·Dec 6, 2016

Hello I'm writting my own boilerplate with express, and js framework for front-end(Angular2) I want to include profile picture options.

So now, from the input file i encode to base 64 the picture, i send the base 64 image to the server, i decode base 64 image and store it as a picture.

For displaying image to the client, i was thinking to encoded image stored on server to base 64 and sending it to front-end and display it under img src=""

It is good or bad implementation ?

For bigger file (video, files), what did you recommend ?

Thank's