Youtube-dl-WebUI/utilities.php
p1rox 30f2477d34 Password protection added with session
Functions freeSpace and destFolderExists moved to utilities.php
2014-03-21 21:15:45 +01:00

22 lines
No EOL
552 B
PHP

<?php
// Test if destination folder exists
function destFolderExists($destFolder)
{
if(!file_exists($destFolder))
{
echo '<div class="alert alert-danger">
<strong>Error : </strong> Destination folder doesn\'t exist or is not found here.
</div>';
}
}
// Convert bytes to a more user-friendly value
function human_filesize($bytes, $decimals = 0)
{
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}
?>