9 Star 18 Fork 3

zhengfei / zhengfei-flex-image-upload

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

#falsh图片上传按钮 从浏览器指定选择图片文件,图片选择成功后,会将图片转换为base64字符串返回

##Demo展示 (注:启动一个Server,再运行此flash)

    git clone https://git.oschina.net/657812595/zhengfei-flex-image-upload.git  //clone代码
    cd zhengfei-flex-image-upload/bin-release/  //进入发布目录
    ls //看见一个Main.html了没
    python -m SimpleHTTPServer 3000 //用浏览器打开吧

##简单使用

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<div id="test"></div>
<script type="text/javascript" src="swfobject.js" ></script>
<script type="text/javascript">
    function selectSuccessCallBack(err,data){
        if(err) {
            //Error handler .....
            return;
        }
        //成功会返回json对象,例如:
        /* {
            fileName:"图片名",                     //example test
            fileSize:"图片大小",                    //example 1024
            fileType:"图片类型",                    //example .jpg
            base64Img:"Base64(图片)"              //example 反正就是字符串
         } */
    }
    swfobject.embedSWF("Main.swf", "test", "60", "20", "11.1.0", "playerProductInstall.swf",{
        callFunName:"selectSuccessCallBack" //图片选择成功后回调javascript方法名 默认img2base64Result
    });
</script>
</body>
</html>

##问题反馈

  • QQ: 657812595

Comments ( 0 )

Sign in for post a comment

About

图片选择按钮,将图片转换为base64字符串,便于图片上传,跨浏览器 spread retract
Java
Cancel

Releases

No release

Gitee Metrics

Contributors

All

Activities

load more
can not load any more
Java
1
https://git.oschina.net/657812595/zhengfei-flex-image-upload.git
git@git.oschina.net:657812595/zhengfei-flex-image-upload.git
657812595
zhengfei-flex-image-upload
zhengfei-flex-image-upload
master

Search