Added the uploading functionality

The logic is still wonky as shit but the core functionality is there.