I have an action where I am putting zip files and those zipped files are unzipped. Now, the problem is, when I am unzipping those files....those files are saved into the App_Data folder in a weird format. Note that, I am saving the directory path as the string in my database table(img1).
What I want is, I want to save the path in normal string format like this,
Because when I am trying to show those files like <a href="@Url.Content(Model.filepath)">Download</a>, I am not getting any file because of that weird format.
here is my controller(img13, img14, img15)
May be your issue is in path
it must be
string path = AppDomain.CurrentDomain.BaseDirectory + "/App_Data/uploads/";
Try saving above path using forward slash, take a reference from ZipFile.ExtractToDirectory(zipPath, extractPath);
You can also take a look on complete article on this
https://gallery.technet.microsoft.com/Programmatically-Extract-0544debd
https://www.codeguru.com/csharp/.net/zip-and-unzip-files-programmatically-in-c.htm
https://www.mikesdotnetting.com/article/306/working-with-zip-files-in-asp-net-mvc
Let me know if it doesn't help, i will test your code locally
Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly