[PHP] Converting JPEG to non-progressive format during file upload?

Because I’ll be dynamically loading the uploaded JPEGs into Flash, and Flash doesn’t like progressive JPEGs.

Right now I’ve just got a form in an HTML page which uploads images via PHP. Is there a way I can quickly re-compress the JPEGs during the upload process?