fixed upload

got upload files to work again
it was broken for a while but now it works.
I still need to setup tests for it