Modified file sharing logic.