writing mqtt payload to spiffs file
Use file.write(payload, length); for byte array. length should be the count of payload bytes, not the size of the payload array.

print and write return the count of bytes written. It is not meaningful to use the return value as boolean.