First draft of upload functionality