Write to database, and write file for binduino