cleanup upload helper