finished upload file function