Yes. If you add code like that above it will allow you to validate the size without moving the upload code above. This is actually a better technique since you wouldn't have already uploaded the file before validation and wouldn't need to clean up old files that didn't meet the validation requirement.