Add truncate logic for file receiving.