Servergrid UserLink

... connection ... education ... discovery ... information ...
Welcome to Servergrid UserLink Sign in | Join | Help
in
Home Blogs Forums Photos Downloads Servergrid Join Now Private Messages

Tutorial: Using XCeed ZIP to UnZip files on the server

Last post 01-13-2007, 11:47 PM by nandu. 0 replies.
Sort Posts: Previous
  • Tutorial: Using XCeed ZIP to UnZip files on the server

     01-13-2007, 11:47 PM

    • Joined on 11-21-2006
    • Posts 8
    • Points 46
    • Top 25 Contributor

    You can easily extract the contents of a ZIP file on the server by following the steps given below.

    Please note that in order to work with the example you should install XCeed ZIP for .NET which is available for download (45 days trial) from http://xceed.com/Zip_Net_Whatsnew.html

    Step - 1

    Copy the following DLL's to the BIN directory of your website. If there is no such directory, then you can create it

    Xceed.Compression.dll
    Xceed.Compression.Formats.dll
    Xceed.FileSystem.dll
    Xceed.Zip.dll

    You can locate these DLL files from Program Files\Xceed Components\Bin\.NET folder

    Step - 2

    Add the following code to the Page_Load() event

    Try
    Xceed.Zip.Licenser.LicenseKey = "ZINXX-XXXXX-XXXXX-XXXX"
    Dim zip As New ZipArchive(New DiskFile(Server.MapPath(".") & "\Test.zip"))
    Dim folder As New DiskFolder(Server.MapPath("."))
    zip.CopyFilesTo(folder, True, True)
    Response.Write("Files Unzipped Successfully")
    Catch err As Exception
    Response.Write(err.Message)
    Finally
    End Try

    That's it. Execute the file and you will see a message "Files Unzipped Successfully". You should see a new folder named Test with the required file inside the root of your domain.

    Please make sure to upload Test.Zip into the root directory before attempting to run the above code.


    Regards,
    Anand
    Author: Community Server Quickly - Packt Publishing
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems