The following function is used to return the file size,
$file = file_load($fid)
echo filesize(drupal_realpath($file->uri));
url - it will return the file public url (public://filname.ext)
file_create_url() - it will return there relative url of the file (http://localhost/sites/default/files/filname.ext)
drupal_realpath() - it will return the absolute url of the file path.(sites/default/files/filename.ext)
No comments:
Post a Comment