Skip to content
Permalink
Browse files

Merge pull request #599 from tarasfrompir/patch-3

Update common.class.php
  • Loading branch information...
sergejey committed Aug 16, 2019
2 parents 62a09eb + c2479bd commit 5317cd9125c768864f2ff4b7a985936423732984
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/common.class.php
@@ -1377,3 +1377,16 @@ function get_media_info($file)
}
return $out;
}
function get_remote_filesize($url)
{
$head = array_change_key_case(get_headers($url, 1));
// content-length of download (in bytes), read from Content-Length: field
$clen = isset($head['content-length']) ? $head['content-length'] : 0;
// cannot retrieve file size, return "-1"
if (!$clen) {
return '0';
}
return $clen; // return size in bytes
}

0 comments on commit 5317cd9

Please sign in to comment.
You can’t perform that action at this time.