add temporary file spooling and refactor common logic for both upload scenarios
add temporary file spooling and refactor common logic for both upload scenarios

informatics-isi-edu/hatrac,informatics-isi-edu/hatrac