gxp.LayerUploadPanel Example
See the
layer-upload.js source
to see how this is done.