created an upload function