Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
572 views
in Q2A Core by
edited by

Just saw that v1.7.2 has no way to determine a size of a blob.

If the blob content is saved in the database it would be:

// get size of image
$blobsize = qa_db_read_one_value(
    qa_db_query_sub('SELECT OCTET_LENGTH(content) FROM `^blobs`
                        WHERE blobid=# LIMIT 1', $blobrow['blobid']),
    true);

If the blob content is NULL and the file system is used it would be:

if(empty($blobsize))
{
    $blobsize = filesize( qa_get_blob_filename($blobrow['blobid'], $blobrow['format']) );
}


Hope that helps.

Thx,
Kai

Q2A version: 1.7.2

1 Answer

+1 vote
by
Yes that could be a useful function. Feel free to provide a pull request for it. Otherwise, I'll get to it eventually...
by
please copy and paste the code, i have the flue currently
...