Filter / Hook to get attachment ID before uploading?

You just complicating yourself here. If you want a sequential ID just store it in an option and increment its value with each new upload. There is a very slight possibility of a race condition which might result with two images having the names of IMG_N.png and IMG_N-2.png but it is not likely to happen at all in sites with only one author writing at a time.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)