Added upload function