jQuery Multiple File Upload Plugin 使用方法

微生新翰
2023-12-01

官方主页:http://www.uploadify.com/demo/

<script type="text/javascript" src="plus/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="plus/multiplefileupload/jquery.MultiFile.js"></script>
<input type='file' id='myfileupload' />

<script type="text/javascript">
$(function() {
$('#myfileupload').MultiFile({
max: 5,
accept: 'gif|jpg|png|bmp|swf',
STRING:{
remove:"[删除]",
selected: 'Selecionado: $file',
denied: '不支持上传 $ext 格式的文件!',
duplicate: '文件已经在上传列表中: $file'
}
});
});
</script>

注意,input控件中不要加class="multi",否则初始化函数不起作用。

====================================================

最新修改版本(自用)

<script type="text/javascript" src="plus/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="plus/uploadify/jquery.uploadify.v2.1.0.min.js"></script>
<script type="text/javascript" src="plus/uploadify/swfobject.js"></script>

   $(function(){
$("#myfileupload").uploadify({
'uploader':"plus/uploadify/uploadify.swf",
'script':"plus/uploadify/soupload.asp", //如果要传变量的话可以这样:soupload.asp?id=28
'cancelImg':"plus/uploadify/cancel.png",
'auto':true,
'folder':"/uploads",
'multi':true,
'fileDesc': "jpg,png,doc,docx,rar,zip,ppt,pptx,7z,txt,trf",
'fileExt': "*.jpg;*.png;*.doc;*.docx;*.rar;*.zip;*.ppt;*.pptx;*.7z;*.txt;*.rtf",
'sizeLimit':1000000,
'simUploadLimit':5,
'buttonImg': "plus/uploadify/bg_upload.png",
'width':145,
'height':50,
            'onComplete':function(){$(".attachmentlist").load("ajaxpro/attachment_list.asp?q=ajaxpro&username="+'<%=login_username %>');
});
});

剑冢原创,转载请注明出处。

 类似资料: