write the file received