consolidate cdn upload code.