Today, I did an asynchronous upload of a file and then unzip the thing directly. To extract this to find a lot of information, did 1 hours, posted out, to their own memory.
HttpPostedFileBase imgfile = request.files[0];//gets to the file stream filename = imgfile.filename; Imgfile.saveas (Server.MapPath (". /test/"+ filename");//Save to local var archive = Archivefactory.open (Server.MapPath (". /test/"+ filename");//Find the absolute path of the file through Server.MapPath foreach (var entry in archive. Entries) { if (!entry. isdirectory)//start extracting { entry. Writetodirectory (Server.MapPath (". /test/"), Extractoptions.extractfullpath | Extractoptions.overwrite);//Unzip the address also to the absolute path } }
And then to add is the need to reference a DLL called sharpcompress.dll:http://sharpcompress.codeplex.com/#
C # Extract Files