Quarantine a Dangerous File by Creating a ZIP Archive in PHP

composer require cloudmersive/cloudmersive_document_convert_api_client
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
$apiInstance = new Swagger\Client\Api\ZipArchiveApi(


new GuzzleHttp\Client(),
$config
);
$password = "password_example"; // string | Password to place on the Zip file; the longer the password, the more secure
$input_file1 = "/path/to/inputfile"; // \SplFileObject | First input file to perform the operation on.
$encryption_algorithm = "encryption_algorithm_example"; // string | Encryption algorithm to use; possible values are AES-256 (recommended), AES-128, and PK-Zip (not recommended; legacy, weak encryption algorithm). Default is AES-256.
try {
$result = $apiInstance->zipArchiveZipCreateQuarantine($password, $input_file1, $encryption_algorithm);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ZipArchiveApi->zipArchiveZipCreateQuarantine: ', $e->getMessage(), PHP_EOL;
}
?>

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

{UPDATE} Cool Goal! Hack Free Resources Generator

{UPDATE} Jasper's Rocket Hack Free Resources Generator

Hack The Box — Bank

An introduction to RFID hacking

Six ways to mitigate Enterprise Business Risks in Telecom

Are You Losing Money to Ad Fraud? PeerClick Anti-bot Protection is Coming to Save You!

READ/DOWNLOAD] Lights Out: A Cyberattack, A Nation

Living secure in insecure times — encrypting in Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

A simple PHP site/framework (5/?)

How to Quickly Get Started With PHP and MariaDB

Tutorial: Docker PHP Development setup for the generation of TikTok attention span developers

Example Dockerfile

PHP vs Python: Explanation By The Best Website Development Company