Good day to all. The question is the following: I need to send some photos asynchronously to the server, save them in the server directory in the directory and return the same photos to the client. The problem is that Ajax.BeginForm() not suitable for asynchronous file transfer, here is my question on this: "Click" . Tell me how to do this? Here is my form that sends data not asynchronously.

 @using (Html.BeginForm("PhotoSessionInfo", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })) { <span>Название фотосесии (будет отображаться в галереи): </span> <br /> @Html.TextBox("sessionName", null, new { @class = "sessionName" }) <br /> <br /> <span>Выберите изображение, которое будет являться заставкой фотосесии: </span> <br /> <div id="dropZoneForGeneral"> Перетащите файл сюда или <input value="выберите файл" id="GeneralPhoto" type="file" name="generalPhoto" accept=".jpg, .jpeg, .png"> </div> <br /> <br /> <span>Выберите изображения: </span> <br /> <div id="dropZone"> Перетащите файл сюда или <input value="выберите файлы" multiple type="file" name="photos" accept=".jpg, .jpeg, .png"> </div> <button type="submit" id="submit"> Отправить </button> } 
  • I do not know the answer, but here’s what google first is stackoverflow.com/questions/166221/… - tym32167
  • 1. Who told you that Ajax.BeginForm is not suitable? - Vadim Bondaruk
  • 2. Why don't you want to use jquery or just javascript? - Vadim Bondaruk
  • Because I already asked a question about Ajax.BeginForm and they said that it was impossible to transfer the file in this way - Lev Kostychenko

0