From 7e45015f80c1ec0618d3034b57f18cc5c70f49be Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 19 Jan 2011 15:54:36 +0000 Subject: Return real file sizes in micro-format.php --- diff --git a/site/app/webroot/services/micro-format.php b/site/app/webroot/services/micro-format.php index 1b812ef..cb5b44b 100644 --- a/site/app/webroot/services/micro-format.php +++ b/site/app/webroot/services/micro-format.php @@ -143,7 +143,13 @@ if (!empty($errors)) { $url = FILES_HOST . '/' . $row['id'] . '/' . $files['filename']; else $url = SITE_URL . '/downloads/file/' . $files['file_id'] . '/' . $files['filename']; - $size = (int)$files['size'] * 1024; + + $size = filesize(PUBLIC_STAGING_PATH . "/{$row['id']}/{$files['filename']}"); + if (!$size) + $size = filesize(REPO_PATH . "/{$row['id']}/{$files['filename']}"); + if (!$size) + $size = (int)$files['size'] * 1024; + if ($row['name']) $name = $row['name']; else -- cgit v0.9.1