One thing you can do is use [man]cURL[/man] to download the file instead. However, the downside to this is that it requires the cURL library to be installed.
If you want a really robust solution, you can use [man]ini_get/man to test if allow_url_fopen is set to true and, if so, do the normal file_get_contents() or whatever it is you're doing.
If it isn't, use [man]extension_loaded/man to determine if cURL is available. If it is, use it instead.
If it isn't... well, you could attempt to use [man]fsockopen/man to open a socket to the remote webserver and imitate the HTTP protocol yourself, however I personally would simply abort execution of the script/app and display/log an error message for the developer informing him/her that they need one or the other. 😉
EDIT: So we're back to the double post sneak attack, eh Charles? I see how it is...