Docker install: Get file size and write bytes to MySQL

Hello,

I’ve got the write binary file node which writes files to the file system from an HTTP Request.
After that, I’m writing file name etc. to MySQL.

Now, I’d like to get the file size and write it to MySQL as well.
Is there a way of knowing the file size?

It’s not the most elegant solution, but you could utilize the Execute Command node in combination with the ‘du’ linux command. This command would output just the file size in bytes:

du <filename> | cut -f 0

Just replace <filename> with your file name.

4 Likes