diff --git a/tinyfilemanager.php b/tinyfilemanager.php
index d1848d95..24a2ea4d 100644
--- a/tinyfilemanager.php
+++ b/tinyfilemanager.php
@@ -932,6 +932,22 @@ function get_file_path()
         // Call the download function
         fm_download_file($path . '/' . $dl, $dl, 1024); // Download with a buffer size of 1024 bytes
         exit;
+    } else if ($dl != '' && is_dir($path . '/' . $dl)) {
+        chdir($path);
+
+        // zip the directory
+        $zipname = sys_get_temp_dir() .'/'. $dl;
+        $zipper = new FM_Zipper();
+        $res = $zipper->create($zipname, $dl);
+
+        if ($res) {
+            // download the zip file and delete it afterwards
+            fm_download_file($zipname, $dl . '.zip', 1024);
+            unlink($zipname);
+        } else {
+            fm_set_msg(lng('Error while creating Archive'), 'error');
+        }
+        exit;
     } else {
         // Handle the case where the file is not found
         fm_set_msg(lng('File not found'), 'error');
@@ -2208,6 +2224,7 @@ class="edit-file"> ..." href="?p=©=">
                         
                         
+