One thing I think you're missing is that anyone can download such a file,
even people you don't want to download it -- and once I've downloaded the file
to my computer, I can then proceed to crack your password at my leisure, and
there's nothing you can do about it because the file is on *my* machine and
out of your control.
If the directory is password-protected on *your* server, then a
properly-configured server will kick me out after a predetermined number of
unsuccessful attempts.
If you use a long password consisting of both upper and lower case
letters and numbers generated by a random password generator, very few
people are qualified to crack it, and those who are must have some
good reason to do so to bother with it. I have cgi on my site(turned
off at the present), which allows download with a password, but it
would be a mistake to think that server side gives complete protection
either. You had better know what you are doing to write server side
scripts used for cgi. If you are not very careful you can end up with
something much worse than having your password protection cracked. You
can end up with your whole site defaced or taken down completely. In
short, there is no absolute method to protect anything on the web or
on your computer. People have spent much money and time attempting to
do so. Protection for DVD encryption and much more elaborate Blu-ray
encryption was soon cracked, and a business on an island state, where
it is not illegal, does a very good business in selling programs to
allow copying of encrypted DVD and Blu-ray discs. And the US CIA, the
Chinese, etc. are very good at cracking encryption if it is in their
interest to do so. Although server side scripting is very powerful for
the owner of the site, it also is very powerful for hackers. And don't
make the mistake of thinking that such problems are very important
only for Microsoft servers. A few years ago some hackers in Brazil
defaced a huge number of sites that were on non-Microsoft servers.