mirror of
https://github.com/timendum/Youtube-dl-WebUI.git
synced 2025-03-01 16:13:35 +08:00
22 lines
No EOL
552 B
PHP
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];
|
|
}
|
|
|
|
?>
|