Article From:https://www.cnblogs.com/fengnan/p/9967471.html

It’s a data type problem, so specify text.

$(function() {
            $("#submitbtn").click(function() {
                var file = $("#file_upload").val();                                
                if (file == '') {
                    alert("Upload template cannot be empty");
                    return false;
                } 
                $.ajaxFileUpload({
                       url: "${pageContext.request.contextPath}/inventoryController/importinventory.form",
                       type:"post",
                       fileElementId: 'file_upload',
                       dataType: 'text',
                       success: function (data) {
                             alert(data);                             
                             /* if(data=='Field '{Alert ('List Import Successful! ).Location.rEload ();}else{Alert ('List import failed, please check the file');}*/
                        },
                        error: function (data, status, e) {                            
                            alert('Callback failure');
                        }
                    });
            });
        });

 

Leave a Reply

Your email address will not be published. Required fields are marked *