gpt4 book ai didi

java - struts2中如何使用Ajax上传Imagefile

转载 作者:行者123 更新时间:2023-12-01 13:07:22 24 4
gpt4 key购买 nike

function myPage() {
var url1 = "imagefile="+"img/"+ absPath;

$.ajax({
type : "POST",
url : "fileupload.action",
data : $('#uploadImagess').attr('mynewfile'),
success : function(data) {
alert("success Insert : "+filePath);

},
error : function(data) {
alert("ERROR IN SAVE DATA");
}

});
}

最佳答案

$(document).ready(function(){   
$('input[type="file"]').ajaxfileupload({
'action': 'imageupload.action',
'onComplete': function(response) {
$('#upload').hide();
alert("File SAVED!!");
},
'onStart': function() {
$('#upload').show();
}
});
});
</script>

关于java - struts2中如何使用Ajax上传Imagefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23171202/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com