daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Jan 18th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public HttpFile UploadedImages { get; set; }
  2.    
  3. <input type="file" id="files" name="files" multiple="multiple">
  4.  
  5. <script type="text/javascript">
  6.     var picArray = [];
  7. </script>
  8.    
  9. picReader.addEventListener("load", function (event) {
  10.     var picFile = event.target;
  11.     picArray.push(picFile.result);
  12. }
  13.  
  14. formData = new FormData();
  15. formData.append("UploadedImages", picArray);
  16.  
  17.         var ajaxRequest = $.ajax({
  18.             type: 'POST',
  19.             url: '/api/CRUD/AddGlass/',
  20.             processData: false,
  21.             contentType: false,
  22.             data: formData,
  23.             },
  24.             error: function (jqXHR, textStatus, errorThrown) {
  25.                 var requestResponse = {
  26.                     httpStatus: jqXHR.status,
  27.                     error: errorThrown || jqXHR.statusText,
  28.                 };
  29.             }
  30.         });
  31.    
  32. public string AddGlass(GlassBindingModel model)
  33. {
  34.     // Here model.UploadedImages is null
  35. }
RAW Paste Data
Top