Implement the transferFile method.