Create zip folder in amazon S3

Mar 11, 2013 at 1:05 PM
0
down vote
favorite
I have to created a folder in the amazon S3. Now have to convert that folder in the zip file. I have used the DotNetZip Liberary to convert to the .zip file.

public void ConvertToZip(string directoryToZip, string zipFileName)
{
    try
    {

        using (client = DisposableAmazonClient())
        {
            var sourDir = new S3DirectoryInfo(client, bucket, directoryToZip);

            var destDir = new S3DirectoryInfo(client, bucket, CCUrlHelper.BackupRootFolderPhysicalPath);

            using (var zip = new ZipFile())
            {
                zip.AddDirectory(sourDir.FullName); // recurses subdirectories
                zip.Save(Path.Combine(destDir.FullName, zipFileName));
            }
        }

        logger.Fatal("Successfully converted to Zip.");
    }
    catch (Exception ex)
    {
        logger.Error("Error while converting to zip. Error : " + ex.Message);
    }
}

When I run the code it is showing the error "The given path's format is not supported."