jquey ajax upload file in asp.net mvc

Posted by CoffeeCode on Stack Overflow See other posts from Stack Overflow or by CoffeeCode
Published on 2010-03-11T20:11:07Z Indexed on 2010/03/11 20:14 UTC
Read the original article Hit count: 270

Filed under:
|
|

i have a file in my view

<form id="upload" enctype="multipart/form-data">
<input type="file" name="fileUpload" id="fileUpload" size="23" /><br />
</form>

and an ajax request

$.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) {
                }
            });

but there is no file in the Request.Files. Whats wrong with the ajax request?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about asp.net-mvc