Only generate id & key after file is validated