Master/Slave communication

It looks like the Master receives the file

In your code for the Master I see nothing that receives a file, or anything else for that matter.