writing the file to temp and further sending to client when complete
(**** Works but error handling to be done****)