Support for file uploads

r? @wangjohn