get base64 of input type file (image(

415 views
Skip to first unread message

Ziobudda

unread,
Mar 19, 2014, 4:29:11 AM3/19/14
to ang...@googlegroups.com
Hi all, I have a form that I need to upload via POST to a REST services with this body:

{ file: base64_version,
  filename: the_filename
}

Is there some documentation/tutorial/howto that explain me how to do this that works on angularjs 1.2.x? 

I have searched for them, but for the moment I have founded only code that are not for my case or that it does not work with angularjs 1.2.x

For people that use Drupal: i need to upload a file via rest/file

M.
--
Davide Morelli




Sander Elias

unread,
Mar 19, 2014, 4:55:28 AM3/19/14
to ang...@googlegroups.com
Hi Michel,


has nothing to do with Angular. use btoa(file_contents) to get the base64 encoded version.

Regards
Sander

Ziobudda

unread,
Mar 19, 2014, 5:37:19 AM3/19/14
to ang...@googlegroups.com
Hi, the function that are indicated in the link (atob and btoa) works only with IE10+

I have to support at least ie9.

Thanks however for the link.

M.

--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

--
Davide Morelli




Reply all
Reply to author
Forward
0 new messages