Getting the last autoincremented ID value.
This will be used as a filename for the downloaded file.