Validations not run till after action in controller is calle

Hi there

I am uploading data and images in a form

and I am trying to validate the url of the img before it is uploaded and
record is saved…

the controller works fine when the url is valid

but while trying to test invalid url’s I found that the validations are
run until the end of the action

is there a way to run validations on a post before the action is called?