Possibility of Downloading a file with a specified content length slightly bigger than actual file

I want to know if it’s possible to download a file that has a file size lesser than the specified content length.
For example, let’s say it has an actual size of

size: 3165076 Bytes

And the specified content length is

3336523 Bytes

From my previous experience this results in an infinite download loop. So i want to know if it’s possible to round off the download when it has reached its total size or better still specify a size range