Using the API to upload files

See this post by @aaronsheldon.