Document Upload code for initial doc creation and upload