swfupload upload editor is a flash avatar editing and uploading plug-in that supports local upload, preview, video shooting and network loading. It can be zoomed, cropped, rotated, positioned and color-adjusted. It also supports asp, asp.net, jsp , php and other multiple languages
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 into the editing panel.");break;
case 3:
If(msg.type == 0)
alert("The camera is ready and the user has allowed use.");
}
alert("The camera is ready but the user has not allowed it to be used!");
}
alert("Camera is occupied!");
}
break;
case 5:
If(msg.type == 0)
If(msg.content.sourceUrl)
alert("The original image has been successfully saved to the server, the url is: n" msg.content.sourceUrl);
}
alert("The avatar has been successfully saved to the server, the url is: n" msg.content.avatarUrls.join("n"));
}
break;
}
);
document.getElementById("upload").onclick=function(){
swf.call("upload");
};
});
Demo picture:
The above is a simple usage example of swfupload in this article. I hope it can be helpful to everyone.