Skip to content

Instantly share code, notes, and snippets.

View akshit-arora's full-sized avatar

Akshit Arora akshit-arora

View GitHub Profile
@akshit-arora
akshit-arora / zip_extract.php
Created January 8, 2024 06:54
Expanding archive files securely
<?php
define('MAX_FILES', 10000);
define('MAX_SIZE', 1000000000); // 1 GB
define('MAX_RATIO', 10);
define('READ_LENGTH', 1024);
$fileCount = 0;
$totalSize = 0;
$zip = zip_open($file);