Example allows to upload ZIP files and extract ZIP on server side. This gives users method to upload multiple files and folders at once.
Java Script "CheckAddUnZIP(fileInputObj)" function on client side adds UnZIP? checkbox if user selects file with ".zip" extention.
There are 2 available methods for UnZIP operations:
- Default. J# .NET and CLS-compliant built-in "java.util.zip" namespace. To run this sample you need to install J# Redistributable Package on server.
Versions 1.0, 1.1 and 2.0 of J# you can download (4-7 MB) here.
After J# installed copy file C:\WINDOWS\Microsoft.NET\Framework\[version]\vjslib.dll to Bin\ folder of your application or make reference to "vjslib" libary in Visual Studio.
Example uses parts of Microsoft sample code.
- Free open source SharpZipLib .Net control. You can download assembly and get more info about SharpZipLib control at their web-site.
Replace Form action parameter's value with the "SharpZipLibfilesupload.aspx" to use this control.
If Java Scripts disabled or filename is hidden (Opera 5) you need to realize this feature using static checkboxes!
For browsers which dont supports "onSelect" or "OnChange" event for file inputs i.e for Opera 6, Netscape 6, 7, Mozilla 0.0-1.5 function "CheckFileInputs()" executed each 0.5 seconds!
Other examples
View C Sharp source code
View VB NET source code
Used files: Bin\Element-IT.PowUpload.dll, Web.Config, ZIPUpload.htm, PowUploadScripts.js, Styles.css [Optional]
For J# UnZIP feature: Bin\vjslib.dll, JSharpZIPfilesupload.aspx
For SharpZipLib UnZIP feature: Bin\ICSharpCode.SharpZipLib.dll, SharpZipLibfilesupload.aspx