帮助列表 |
//插件下载官网:http://www.plupload.com/
<script type="text/javascript" src="plupload.full.min.js"></script>
<script type="text/javascript">
var uploaderObj = new plupload.Uploader({ //实例化一个plupload上传对象
browse_button : 'selectFiles',//触发文件选择对话框的按钮,为那个元素id
runtimes: 'html5,flash,silverlight,html4',
url: 'http://upload.dvr.aodianyun.com/v2/DVR.FormUpload',
chunk_size: '5mb',
max_retries: 3,
filters: {
// Maximum file size
max_file_size : '4096mb',
// Select the duplicate files are not allowed
prevent_duplicates : true
},
multipart_params: {
access_id : '',
expires : '',
signature : '',
signature_nonce : ''
},
/*参数说明:
1、access_id = 从奥点去控制台获取access_id
2、expires = 过期时间,值为时间戳
3、signature_nonce = 随机数,字符串
4、signature = md5($access_key.$expires.$signature_nonce) 将access_key、expires、signature_nonce这三个参数直接拼接进行md5加密
*/
// Flash settings
flash_swf_url: 'js/Moxie.swf',
// Silverlight settings
silverlight_xap_url: 'js/Moxie.xap',
init: {
FileFiltered: function(uploader,file){
//上传前回调,可进行参数过滤
},
UploadProgress: function(uploader,file){
//上传过程中,触发
},
QueueChanged: function(uploader,file){
},
FileUploaded: function(uploader,file,responseObject){
//上传完成回调
//responseObject.status 是http code
//responseObject.response = {Flag = 100,FlagStrgin = "成功",fileName = "文件名",location = "URL地址"}
},
ChunkUploaded: function(uploader,file,responseObject){
//上片上传回调
},
FilesRemoved: function(uploader,file){
//删除操作回调
}
}
});
uploaderObj.init(); //初始化
</script>