Anyone have any ideas on how to FTP a ZipArchive MemoryFile to another server? Is it possible for the FTP component to access the FTP ZipArchive MemoryFile in memory without having to save it to disk first?
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Yemi (had 1362 views)
Yes, using filesystem, you can copy a ZipArchive MemoryFile into an FtpFile since they derive from AbstractFile class. The archive will be created in memory and will be uploaded using FTP to a specified FTP server.
zipFile = new MemoryFile( @”RAM:\memoryFile.zip” ); zipArchive = new ZipArchive( zipFile ); folder2zip = new DiskFolder( folderTozip ); folder2zip.CopyFilesTo( zipArchive, true, true ); …
FtpConnection ftpConnection = new FtpConnection( hostname,username, password ); ftpFile = new FtpFile( ftpConnection, “zipfile.zip” ); zipFile.CopyTo( ftpFile, true );
Note that you cannot, from your FTP server, access a MemoryFile located on another machine which is a FTP client of the FTP server.
Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Mohamed [Xceed] (had 1420 views)