first version of the upload.js script