refined dlg-upload.js