implement the recursive upload.