Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax file upload in mvc application
    primarykey
    data
    text
    <p>in my MVC app i using Ajax upload (Version 3.5 (23.06.2009)) in this part of code:</p> <pre><code>&lt;div id="userPhotosUpload"&gt; &lt;span class="tabs_fieldDesc"&gt;@Html.Label("txtPhotoDescription", "Desc")&lt;/span&gt; @Html.TextBox("txtPhotoDescription", "", new { @maxlength = "30", @class = "tabs_fullLength" }) &lt;div class="buttonLine"&gt; &lt;button id="btnAddUserPhoto"&gt;Add picture&lt;/button&gt; &lt;/div&gt; &lt;input id="txtSelectedPhotoFolderId" type="hidden" value="" /&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { //photo upload var photoUpload = new AjaxUpload($('#btnAddUserPhoto'), { action: '/Profile/ProcessPhoto', name: 'uploadfile', responseType: 'json', autoSubmit: true, onSubmit: function (file, ext) { showProgressBar(); photoUpload.setData({ photoDescription: $('#txtPhotoDescription').val(), idPhotoFolder: $('#txtSelectedPhotoFolderId').val() }); }, onComplete: function (file, response) { hideProgressBar(); $('#txtPhotoDescription').val(''); var currentSelectedFolderId = getSelectedFolder(); LoadPhotoFolders(); SelectPhotoFolder(currentSelectedFolderId); } }); &lt;/script&gt; </code></pre> <p>If I upload bigger file then 1MB, AjaxUpload dont call method in controller:</p> <pre><code>[Authorize] [HttpPost] [AcceptVerbs(HttpVerbs.Post)] [ValidateInput(false)] public JsonResult ProcessPhoto(string photoDescription, Int64 idPhotoFolder) { //process request with file } </code></pre> <p>and <a href="http://www.fiddler2.com/fiddler2/" rel="nofollow">Fiddler2</a> show me this:</p> <blockquote> <p>POST /Profile/AddUserPhoto HTTP/1.1 Host: localhost:55538 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8 Accept-Language: cs,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Connection: keep-alive Referer: Cookie: AspxAutoDetectCookieSupport=1; .ASPXAUTH=AB45C67E90AD19402C47818CC4BC78504C96F6BB063E07F89E918F22D3A42B441B14B57818448BAAD3ABEEED48C1EA41431C89F149B3BA53D59950694F33C447462EE56AC33CFB54F1ADAC7B7A4F5D69F6ED3855A649F217EDC56B2250E6BFC87052C0640C1C191F212A76B3A9D9973609F6E537992BBADBC1A3F97853A8B90485DE9C11819D54D1F0D0F9838EDAE73E; ASP.NET_SessionId=gflyfmea2ty2gm3i4rea2adx Content-Type: multipart/form-data; boundary=---------------------------481414423196 Content-Length: 6046387</p> <p>-----------------------------481414423196 Content-Disposition: form-data; name="photoDescription"</p> <p>-----------------------------481414423196 Content-Disposition: form-data; name="idPhotoFolder"</p> <p>136 -----------------------------481414423196 Content-Disposition: form-data; name="uploadfile"; filename="sam_1103.jpg" Content-Type: image/jpeg</p> <p>HTTP/1.1 504 Fiddler - Receive Failure Content-Type: text/html; charset=UTF-8 Connection: close Timestamp: 15:30:34.321</p> <p>[Fiddler] ReadResponse() failed: The server did not return a response for this request.</p> </blockquote> <p>Some idea where is problem?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload