upload.js fixes