I think it would be better to wrap the entire widget in a form and make the "Upload" button a submit button. This will also be read better by screenreaders.