Right now, I have a text field in my registration area for URL for a image, and it has option to upload image, they click on that link, and get a popup with browse button. They select their image, and then select upload button, when it finishes I use the below to close the window and introduce value to readonly field.