Documentation
TempDirectory (extends TempFile)
usage
tempdir = new TempDirectory();
Creates a temporary directory (in /Files/tmp/) that you can use to create an archive, or to reorganize files.
exemples
// create a temporary directory, copy files into it and proposes the download of an archive of these files to the user.
include_once("../Kernel/common/file.class.php");
$tmpdir = new TempDirectory();
$tmpdir->create();
$file = new File('/media/picture1.jpg');
$file2 = new File('/file/picture1.tiff');
$file->copy($tmpdir);
$file2->copy($tmpdir);
$archive = $tmpdir->compress();
$archive->forceDownload();