Direct measurement of the upper critical field in cuprate superconductors