在angularjs中将图像转换为base64 [英] convert image to base64 in angularjs

查看:639
本文介绍了在angularjs中将图像转换为base64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求用户将其图像上传到哪里,我必须将其转换为某种内容并将其发送到.Net REStful服务.我是angular js的新手.有人可以帮忙吗

I have a requirement where user will upload their image and i have to convert it into something and send it to .Net REStful service. I am new to angular js. Could someone please help

推荐答案

从此处回答 https://stackoverflow.com/a/24880314/625189

我建议您使用 https://github.com/ninjatronic/angular-base64 .

I would recommend you to use https://github.com/ninjatronic/angular-base64.

在按照说明使用该库之后,您可以简单地 致电:

After following instructions for using this library, you can simply call:

var imageData=$base64.encode(image);

别忘了插入您的模块:

.module('myApp', ['base64'])

这篇关于在angularjs中将图像转换为base64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆