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

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");
               };
           });

演示图:

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

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

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgfwjj.html