this is the usefull wordpress wideget. it has upload field for uploading media and getting url in layout. this is boilerplate of wordpress widget and we are adding upload media field in admin layout.