Comparison of field-aligned currents at ionospheric and magnetospheric altitudes