writing the file to temp and further sending to client when complete
(**** Not sure if works ****)