//头像上传 Uploadify 插件 $('上传文件的Input对象').uploadify({ swf : PUBLIC + '/Uploadify/uploadify.swf', //引入Uploadify核心Flash文件 uploader : 'test.php', //PHP处理脚本地址 width : 120, //上传按钮宽度 height : 30, //上传按钮高度 buttonImage : PUBLIC + '/Uploadify/browse-btn.png', //上传按钮背景图地址 fileTypeDesc : 'Image File', //选择文件提示文字 fileTypeExts : '*.jpeg; *.jpg; *.png; *.gif', //允许选择的文件类型 formData : {'session_id' : sid}, //上传成功后的回调函数 onUploadSuccess : function (file, data, response) { //file 是上传的文件名 //data 是返回值 } });
来源:http://www.cnblogs.com/tlijian/p/3580363.html