Updated client to open file and prepare to start sending.
merged old code with new