File upload in many steps

211
December 01, 2017, at 10:05 AM

Using Asp.Net MVC 4, I have a requirement to upload a file in two steps:

  1. First page in modal window: pick a file to upload and click submit button. Send the file to the server read first line in the file and return message to client to be displayed on second page.
  2. Second page (in the same modal window): display message returned from first step and if user decides to save file content to server, the file is sent again to server. Read file content and save it to database.

I'm using Ajax to submit and load page1 and page2 partial views and strongly typed viewModel:

public class MyViewModel 
{
     public HttpPostedFileBase MyFile { get; set; }
} 

I have to use JQuery and Ajax as I have to change modal window content with partial views without reloading the hole web page or changing URL.

In order to send the file a second time to server, I need to send the model (that contains the file: HttpPostedFileBase ) back to client which is done via Ajax get action. And again submit the model to server using second Ajax post.

How can I maintain HttpPostedFileBase object content to the second submit?

READ ALSO
Best way to handle shopping cart on the front end?

Best way to handle shopping cart on the front end?

I am building an e-commerce store using Nodejs and ejs and jquery on the front end

166
Changing .text to .html

Changing .text to .html

Simple question I think for someone that knows what they're doing, but I'm still learning scripting

238
How to modify tooltip of Horizontal Multi-Bar Chart NVD3

How to modify tooltip of Horizontal Multi-Bar Chart NVD3

Is it possible that the tool tip of the second data can be modify in Horizontal Multi-Bar?

246