working draft for upload handler