Corrupted docx file

I have uploaded docx file in the browser, then sent the file to the server via Meteor method call. Length of the data received by the server was same as sent from the client. However saving this data to the disk (using fs.writefileSync) yields corrupted file with different size (bigger) then the original. Serve is UBUNTU. Ideas ? Thanks.

Perhaps the file is encoded using base64, and you need to decode it before saving to the FS?

The size of the disk is the same size loaded to the browser and same size received on the server. It is only the fs.writeFile on the server which generates a different size. So I cannot see how encoding is related.

The file is a docx file which is loaded from Windows instance and being saved on UBUNTU machine, if this additional info adds value.