method addToTmp documentation in bbn\User
Adds a file to the tmp folder of the user and returns its path.
function(string $file, string $name = NULL, $move = true)
{
if ($this->auth) {
$fs = new System();
$path = $this->getTmpDir().microtime(true).'/';
if ($fs->isFile($file) && $fs->createPath($path)) {
$dest = $path.($name ?: X::basename($file));
if ($move) {
if ($fs->move($file, X::dirname($dest)) && $fs->rename(X::dirname($dest).'/'.X::basename($file), X::basename($dest))) {
return $dest;
}
}
elseif ($fs->copy($file, $dest)) {
return $dest;
}
}
}
return null;
}
Adds a file to the tmp folder of the user and returns its path. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2025
BBN Solutions