如上图,选择mp3后上传音频报302错误。
解决办法:
将session_id携带到url中即可,如:formData
$("#upload_picture").uploadify({
"height" : 30,
//将session_id传入
"formData" : {'session_id': "<?php echo session_id(); ?>"},
"swf" : "__STATIC__/uploadify/uploadify.swf",
"buttonText" : "上传音频",
"buttonClass" : "",
"uploader" : "{:U('English/uploadPicture')}",
"width" : 120,
'removeTimeout' : 1,
'fileSizeLimit' : "10MB",
'multi' : false,
'auto' : true,
'fileTypeDesc' : '请上传格式为 mp3 、wma的文件',//只允许上传图像
'fileTypeExts' : '*.mp3; *.wma;',
"onUploadSuccess" : function(){
//上传之后的处理
},
"onUploadStart" : function(file){
},
'onFallback' : function() {
alert('未检测到兼容版本的Flash.');
}
})
查看官网解决方法:
http://www.uploadify.com/documentation/uploadify/using-sessions-with-uploadify/