MDL-15777 more fixes for portfolio to use file api