I use flow.js, which has some nice angular bindings in the same project
(ng-flow) on the frontend. It generates multipart/form uploads that are
relatively easy to process on the backend.

e

On Sun, Sep 28, 2014 at 2:37 AM, bolang <[email protected]> wrote:

> Hi all,
>
> I want to ask the "right" way in angularjs to upload file, in my case
> image file.
>
> So far, i worked with JSON API and i uploaded the file by encoded it in
> base64 and included it in json string.
> I did it because this is the requirement given by the senior programmer.
>
> And then i just found that we can do it in multipart/form way.
> (It might sounds funny, but i am not really a web programmer, my previous
> job was embedded system programmer :) ).
>
> I think multipart/form way is more common in web programming, but i also
> find it to be hacky in angularjs because angular's ng-model doesn't work on
> inputs with type="file".
> I am wondering if this behaviour is intentional, because i think angularjs
> developers will be able to do it, if they want.
>
> So, what is recommended way to upload file (in my case image files with
> size < 2 MB), using base64 encoded string or multipart/form-data.
>
> My concern about base64 is that it has bigger size.
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to