Download file using R

I am trying to download a file using download.file

download.file("", "x.png")

But it is not working.
The file is located in

But when I put

As a url for my webrowser, I dont get a single image, I get redirected to a page full of flags, I would guess that download.file() experiences the same

I think you are saying that you agree with me.

Try to open the url

and try to copy url of any flage in png or jpg and paste in the browser... it won't work

Yes ..... totally agree.
I am wondering if rvest package can help me... since I want to download all flags

maybe try a different service