document download hook