new upload function added

The old one will be removed later (before next stable release of course)
Please pull after the csrf pull request