First working version of upload