(01-19-2021, 08:47 AM)mothered Wrote: (01-19-2021, 02:29 AM)Crimin4L Wrote: You may now compress a file on upload into a .zip, .rar, .7z, or .rar4 depending on your choosing:
Excellent Implementation. Do you have any plans for RAR 5.0?
Off-topic, the footer text needs to be updated.
Quote:Copyright © 2019-2020 2021
Haha thank you, I updated ctrlhub but totally forgot about anoncity xD
Also, what is the extension for rar 5.0; "
.rar5"?
EDIT: Actually, I thought the difference between rar and rar4 was just the different extension type but rar4 is still just a ".rar" lolololol. Here is the compression code:
PHP Code:
$zip = new ZipArchive();
// $target['file_path'] is the path + file name + whatever extension you choose. Example: If you choose ZIP, $target['file_path'] value will look like this:
// "u/A1B2C3/filename.zip"
// or if you pick 7Z, the value will be "u/A1B2C3/filename.7z"
// Then below is where the compressed file is created, with what ever extension you used, but the METHOD used is still the same (Guessing its the ZIP compression method).
$zip->open($target['file_path'], ZipArchive::CREATE);
$zip->addFile($_FILES["fileToUpload"]["tmp_name"], basename($_FILES["fileToUpload"]["name"]));
$zip->close();