I have a web app that is connected to a mySQL DB in BLOB Format, and there are some files stored in the DB, how can I fetch their sizes and add them to a new column in the table I'm using ? And what is the best approach to get file size of an uploaded file in JAVA ?!
For your new records that will be processed in Java you can use
File.length() if you're working with a
And for existing records, you can use
OCTET_LENGTH(your_column_name) statement (source: Calculating total data size of BLOB column in a table) which will give you the size in bytes.