File upload from the gateway

Includes pull request #49

@jankeromnes™