But it requires form submit for uploading the selected file. If you want to store image file and display preview without reloading the whole page then you need to use jQuery AJAX.. Send the selected file using the FormData object in AJAX request. Load Index Page >> 'Click Download Zip' >> Invoke Ajax post method >> Invoke MVC Controller Method (Which will be using DotNetZip library and Zip the files) >> save file. Let first add the DotNetZip library reference to our project. For that you need to navigate to Tools >> NuGet package Manager >> Package Manager Console The approach I opted for is detailed below. I made a couple of minor changes to the HTML file, adding a JavaScript call to the link and adding an empty
Hi all. I'm trying to create a button to download a file using jQuery and a FileActionResult. All data are correctly retrieved, but I cannot retrieve download file. This is my javascript code: <