2024年5月6日发(作者:)
// Call user-supplied (or default) onStart(), setting
// it's this context to the file DOM element
var ret = ($element, []);
// let onStart have the option to cancel the upload
if(ret !== false)
{
$('form').submit(function(e) { opagation(); }).submit();
} else {
uploading_file = false;
}
}
};
// Mark this element as setup
$('ajaxUploader-setup', true);
/*
// Internal handler that tries to parse the response
// and clean up after ourselves.
*/
var handleResponse = function(loadedFrame, element) {
var response, responseStr = $(loadedFrame).contents().text();
try {
//response = $.parseJSON($.trim(responseStr));
response = (responseStr);
} catch(e) {
response = responseStr;
}
// Tear-down the wrapper form
gs().remove();
();
uploading_file = false;
// Pass back to the user
(element, [response, ]);
};
/*
// Wraps element in a
'})
// Insert 's for each param
.before(function() {
var key, html = '';
for(key in ) {
var paramVal = [key];
if (typeof paramVal === 'function') {
paramVal = paramVal();
}
html += '';
}
return html;
});
}
});
}
})( jQuery )
$('#analysisLogFile').ajaxfileupload({
action: '/upload_log_object',
valid_extensions : ['doc','docx','xlsx','xls','jpg','png'],
params: {
extra: 'info'
},
onComplete: function(response) {
$("#analysisLogFilePath").attr("value",th);
},
onStart: function() {
return true; // cancels upload
},
onCancel: function() {
('no file selected');
}
});
发布评论