If you're talking about file compression, then since JPEGs are already in a compressed format, compressing them again for upload is pointless. (Try it: take a JPEG image, compress it, then compare the size of the "compressed" file with the size of the original).
If you're talking about degrading the image quality so that the resulting JPEG file is smaller, then the GD functions already cited can do that on the server (they can't do anything on the client, because they and PHP don't run on the client).