mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2026-03-14 12:45:51 +01:00
Merge 5cdc89d4c1 into 6d1e962fc6
This commit is contained in:
commit
48e2e0cc71
1 changed files with 17 additions and 0 deletions
|
|
@ -938,6 +938,22 @@ if (isset($_GET['dl'], $_POST['token'])) {
|
|||
// 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');
|
||||
|
|
@ -2218,6 +2234,7 @@ $all_files_size = 0;
|
|||
<a title="<?php echo lng('CopyTo') ?>..." href="?p=&copy=<?php echo urlencode(trim(FM_PATH . '/' . $f, '/')) ?>"><i class="fa fa-files-o" aria-hidden="true"></i></a>
|
||||
<?php endif; ?>
|
||||
<a title="<?php echo lng('DirectLink') ?>" href="<?php echo fm_enc(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f . '/') ?>" target="_blank"><i class="fa fa-link" aria-hidden="true"></i></a>
|
||||
<a title="<?php echo lng('Download') ?>" href="?p=<?php echo urlencode(FM_PATH) ?>&dl=<?php echo urlencode($f) ?>" onclick="confirmDailog(event, 1211, '<?php echo lng('Download'); ?>','<?php echo urlencode($f); ?>', this.href);"><i class="fa fa-download"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue