User1314407993 posted
In my project users can upload multiple files at a time and they're processed and saved to Blob Storage. I've been given a request to allow users to preview the files uploaded prior to submitting them for processing, and am having some issues.
First I tried to simply pass the collection of IFormFile objects passed into the controller in a RedirectToAction, adding this collection to the view model. That didn't work, because it turns out a RedirectToAction performs a GET and can't take in object
collections, so I tried adding the collection to TempData. I converted the IFormFile objects to a collection of files, converting the actual files into MemoryStream objects... and this threw a runtime exception that the objects aren't serializable.
This is what I want to accomplish - A user uploads files, which are added to the view model in their own collection, and that populates the view. Then the user can decide to submit the previewed files for processing, and that will actually upload the files
for saving.