you can use validation toolkit server validation.
On the server behaviors panel, click the plus button and select WA Validation Toolkit -> Server Validation.
Select Numeric validation and click the lightning bolt next to Server Variable. From the Form Collection select the <fileField> File Size data binding.
The file size will be in bytes. To limit to 2MB, set the Maximum to 2097152.
you can then use the Validation Show If to show an error if validation fails.