Tôi có một tập tin trong quan điểm của tôijQuery ajax upload file trong asp.net MVC
<form id="upload" enctype="multipart/form-data">
<input type="file" name="fileUpload" id="fileUpload" size="23" />
</form>
và một yêu cầu ajax
$.ajax({
url: '<%=Url.Action("JsonSave","Survey") %>',
dataType: 'json',
processData: false,
contentType: "multipart/mixed",
data: {
Id: selectedRow.Id,
Value: 'some date was added by the user here :))'
},
cache: false,
success: function (data) {}
});
nhưng không có tập tin trong Request.Files. Có gì sai với yêu cầu ajax?
js trên không thể tải lên các tệp như thế này. Tốt hơn để sử dụng hành vi tải lên mặc định của trình duyệt. – Hogan