lundi 27 août 2018

How to convert image to base64 code using ember and RESTful api

I have an ember app to list the details about alumni using django rest framework and postgreSQL. I need to upload image(stored in the my storage) along with other details. How can I achieve this in ember?

My model is:

import DS from 'ember-data';

const {
  attr,
  Model
} = DS;

export default Model.extend({
  firstName: attr('string'),
  lastName: attr('string'),
  image: attr('string'),
});

Can I do it by converting to base64 from ember and storing the encoded string? If possible, how?




Aucun commentaire:

Enregistrer un commentaire