fd.append('userId',userid);
fd.append('starName',name);
fd.append('starType',1);
fd.append('fileType',0);
fd.append('weibo',weibo);
fd.append('weixin',weixin);
fd.append('files',$("#file1")[0].files[0])
$.ajax({
url:url+"star/add",
data:fd,
type:'post',
cache: false,
processData: false, // 告诉jQuery不要去处理发送的数据
contentType: false, // 告诉jQuery不要去设置Content-Type请求头
success:function(res){
console.log(res);
alert('添加成功');
location.href='default.html'
},error:function(err){
throw err;
}
})
crossDomain: true, // 如果用到跨域,需要后台开启CORS
uploadify:
$("#uploadify").uploadify({
'debug':true,
'uploader': 'uploadify/uploadify.swf',
'script':url+'profile',
'scriptData':{starId:starid,type:typeid},
'cancelImg': 'uploadify/cancel.png',
'fileExt': exs[typeid],
'fileDesc': 'Image Files',
'fileDataName':'file',
'auto': false, //自动上传
'multi': multi[typeid], //多文件上传
'sizeLimit': nums[typeid], //上传大小
'fileCount': counts[typeid],
'onComplete':function(event, queueID, fileObj, response, data){
console.log(response);
//location.reload();
temp();
}
});