I am facing a problem in that when I close the lid of my laptop(Dell studio xps) after a while the wifi connection is lost.

I want to close the laptop lid at night if I am downloading something and let it run and complete the downloads.

I do not want to keep the lid open, cos obviously I will not be able to sleep with the laptop in the same room.

I have setup the profile to not do anything when the lid is closed but wifi connection is lost.

Can anyone help me out with this?