日期:2014-05-17 浏览次数:20430 次
function ajaxFileUpload() {
$.ajaxFileUpload({
url: 'ajax.ashx',
secureuri: false,
fileElementId: 'FileUpload1',
dataType: 'json',
success: function(data, status) {
if (typeof (data.error) != 'undefined') {
if (data.error != '') {
alert(data.error);
}
}
},
error: function(data, status, e) {
alert(e);
}
})
}
string error = "";
string msg="";
HttpPostedFile file = context.Request.Files[0];
int iFileSize = file.ContentLength;
if (iFileSize > 100000)
//检查images size
{
error = "size limit 100jb";
string result = "{ error:'" + error + "'}";
context.Response.Write(result);
}<