add the upload function, modified app.js