note 80299 deleted from function.escapeshellcmd by cmb
| From: | cmb@php.net | Date: | Wed, 18 Sep 2019 13:57:05 +0000 |
| Subject: | note 80299 deleted from function.escapeshellcmd by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212243@lists.php.net to get a copy of this message | ||
Note Submitter: davidwhthomas
----
To extract an archive file to a specific folder using exec() :
<?php
$result = exec(escapeshellcmd("tar -xvvf /path/to/archive.tar -C /path/to/extract/to/"));
?>
escapeshellcmd() is used here because I am getting the file path via user input / upload.
DT