Measure the exact file
Read width and height in a viewer and multiply them. Retain the original file and check the actual format before exporting a smaller copy.
Preserve usable facial detail
Downscale the whole composition if all roles must stay visible, or crop deliberately if the edit only concerns one area. Verify both limits on the exported file.
Example
A 9000 by 5000 image is 45 megapixels even if compressed down to 5 MB.
Pass condition
The intended upload meets both constraints and all needed people and scene cues remain visible.