Refactor upload function for 'development' env.