• Loading...
Atp UltimateFtp
Uploading files and directories within a ZIP file to an FTP server
Send comments on this topic to ATP, Inc.
Working with Directories > Uploading files and directories within a ZIP file to an FTP server

Glossary Item Box

To upload files and directories within a ZIP file to an FTP server, you will need to add reference to UltimateZip.dll assembly. The UltimateZip is available for download at: UltimateZip Download Page For more information about this product, visit its home page.

The following example code shows you how to connect to an FTP server, extract files and directories from a ZIP file, and upload them to the FTP server on-the-fly.

C# Copy Code
// Connect to an FTP file system.
Ftp ftp = new Ftp();
ftp.Connect(
"atp-inc.net", 21);
ftp.Authenticate(
"test", "test");
// Open an existing zip file.
Zip zip = new Zip(@"c:\test.zip");
// Extract and upload all files within the archive to the FTP server.
// This operation directly uploads files to the FTP server, no temporary files created.
zip.ExtractAll(ftp, "", FileExistsResolveAction.OverwriteAll);
// Close all used resources.
zip.Close();
ftp.Disconnect();
VB.NET Copy Code
' Connect to an FTP file system.
Dim ftp As New Ftp()
ftp.Connect("atp-inc.net", 21)
ftp.Authenticate("test", "test")
' Open an existing zip file.
Dim zip As New Zip("c:\test.zip")
' Extract and upload all files within the archive to the FTP server.
' This operation directly uploads files to the FTP server, no temporary files created.
zip.ExtractAll(ftp, "", FileExistsResolveAction.OverwriteAll)
' Close all used resources.
zip.Close()
ftp.Disconnect()
ATP, Inc. is a Microsoft Partner. Our components are compatible with Windows 7 and optimized for Visual Studio