Flash图片上传组件 swfupload使用指南

Emma ·
更新时间:2024-11-14
· 907 次阅读

swfupload上传编辑器是一款支持本地上传、预览、视频拍照和网络加载的flash头像编辑上传插件,可缩放、裁剪、旋转、定位和调色等,同时支持asp、asp.net、jsp、php等多语种

代码如下:
swfobject.addDomLoadEvent(function () {
               var swf = new fullAvatarEditor("swfContainer", {
                       id: 'swf',
                       upload_url: 'asp/Upload.asp',
                       src_upload:2
                   }, function (msg) {
                       switch(msg.code)
                       {
                           case 1 : alert("页面成功加载了组件!");break;
                           case 2 : alert("已成功加载默认指定的图片到编辑面板。");break;
                           case 3 :
                               if(msg.type == 0)
                               {
                                   alert("摄像头已准备就绪且用户已允许使用。");
                               }
                               else if(msg.type == 1)
                               {
                                   alert("摄像头已准备就绪但用户未允许使用!");
                               }
                               else
                               {
                                   alert("摄像头被占用!");
                               }
                           break;
                           case 5 :
                               if(msg.type == 0)
                               {
                                   if(msg.content.sourceUrl)
                                   {
                                       alert("原图已成功保存至服务器,url为:\n" + msg.content.sourceUrl);
                                   }
                                   alert("头像已成功保存至服务器,url为:\n" + msg.content.avatarUrls.join("\n"));
                               }
                           break;
                       }
                   }
               );
               document.getElementById("upload").onclick=function(){
                   swf.call("upload");
               };
           });

演示图:

以上就是本文关于swfupload的简单使用示例了,希望对大家能够有所帮助。



swfupload flash

需要 登录 后方可回复, 如果你还没有账号请 注册新账号