Julian,
I found this code on PHP.net page on fopen(). It looks as though it should work. However, its success depends entirely on whether or not PHP has write access to the destination directory or file you're working with. If it gives you problems, one thing you can try is to create a file with the same name as your destination file (it doesn't matter if this file has any actual data) and place it in the directory you're workin in, and then change its permissions (chmod 666). However, most people will tell you that this opens a security hole of some sort (though an incredibly tiny one), so use at your own risk. Anyhow, here's the code:
$source = "http://$user_ip//cgi/nph-jpeg.exe?-aw+80+-ah+60+-single+-device+0+-video+0;"
$dest = "newname.jpg";
$source_handle = fopen($source, "rb");
$dest_handle = fopen($dest,"wb");
while (!feof($source_handle)) {
$buffer=fread($source_handle,4096);
fputs($dest_handle,$buffer);
}
fclose($source_handle);
fclose($dest_handle);