swfupload upload editor is a flash avatar editing and upload plug-in that supports local upload, preview, video photography and network loading. It can scale, crop, rotate, position and color grading, etc. It also supports multilingual such as asp, asp.net, jsp, php, etc.
The code copy is as follows:
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("The page successfully loaded the component!");break;
case 2: alert("The default specified image has been successfully loaded to the editing panel.");break;
case 3:
if(msg.type == 0)
{
alert("The camera is ready and the user is allowed to use.");
}
else if(msg.type == 1)
{
alert("The camera is ready but the user is not allowed to use!");
}
else
{
alert("The camera is occupied!");
}
break;
case 5:
if(msg.type == 0)
{
if(msg.content.sourceUrl)
{
alert("The original image has been saved to the server successfully, the url is: /n" + msg.content.sourceUrl);
}
alert("The avatar has been saved to the server successfully, the url is: /n" + msg.content.avatarUrls.join("/n"));
}
break;
}
}
);
document.getElementById("upload").onclick=function(){
swf.call("upload");
};
});
Demo diagram:
The above is a simple example of using swfupload in this article. I hope it will be helpful to everyone.