Unfortunately, made a lot of changes, mainly around removing the hard-coded directory locations and specifying file constants - <Bala>
Added the using namespace line before writing the file contents from the client - <Bala>