Wrote successful upload code. Probably error-prone, but whatever.