file functions

sizefile($size) {#sizefile}

format bytes to human readable file size

echo sizefile(1024);
// 1 Kb

directorysize($dir) {#directorysize}

return size of direcory not recursively it may be slow if direcotry contains lots of files

echo directorysize('cache');
// 100345

getfiletype($file) {#getfiletype}

return content type of file specified by filename

echo get_file_type('');
// application/zip
echo get_file_type('image.jpg');
// image/jpeg

filedownload($filename,$pathtofile,$content='attachment') {#filedownload}

// offers download

// open file to the browser
Try myPortal 2: