How to change the Unzip directory from Appdomain BaseDirectory

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)




Asked by:- SalmanZahir
: 2327 At:- 11/16/2017 11:13:49 AM mvc

1 Answers
profileImage Answered by:- Sam

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

Let me know if it doesn't help, i will test your code locally

At:- 11/16/2017 12:44:53 PM Updated at:- 11/16/2017 2:18:32 PM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use