Guide to Using the Flash Image Upload Component swfupload,
The swfupload upload editor is a flash Avatar editing and uploading plug-in that supports local upload, preview, video photography, and network loading. It can be scaled, cropped, rotated, positioned, and color-based, supports multiple languages, including asp, asp.net, jsp, and php.
Copy codeThe Code 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 has been loaded successfully! "); Break;
Case 2: alert ("the default image is 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 it. ");
}
Else if (msg. type = 1)
{
Alert ("the camera is ready, but the user is not allowed to use it! ");
}
Else
{
Alert ("camera occupied! ");
}
Break;
Case 5:
If (msg. type = 0)
{
If (msg. content. sourceUrl)
{
Alert ("the source image has been saved to the server, and the url is \ n" + msg. content. sourceUrl );
}
Alert ("the Avatar has been successfully saved to the server, and 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 swfupload in this article. I hope it will be helpful to you.