Reputation: 13517
I have an image sitting in my database, for which I need the file size in bytes.
How can I get the file size of a data string in PHP?
Thanks in advance.
Upvotes: 2
Views: 147
Reputation: 1010
This will tell you the data size in bytes:
SELECT OCTET_LENGTH(blob_content) FROM table WHERE id=1
Upvotes: 1
Reputation: 9979
Try this
SELECT key, LENGTH(blob_column) AS size_in_bytes FROM my_table
Upvotes: 2