I am writing an application on ionicframework. Now I am developing functionality for user avatars. Now the application can get a picture from the gallery or camera and using the plugin http://www.newupdate.co/ngimgcrop-image-crop-directive-for-angularjs/ cut it to the avatar. The output is the string Base64. Now I need to upload it to the server or as is, i.e. in Base64, or write to a file and send the ready file to the server. When I try to send as is, I apparently exceed the limit on the length of the line and the server does not process my request.
Question number 1: how to send pictures to the server in Base64?
Or question number 2 for an alternative variant: how to save the Base64 line to a file?