Image

Imagekhyri wrote in Imagephp_dev 😯confused

Problem with fopen on remote image with http

I'm attempting to grab a web cam image, which has its own server/URL, and display it on a page on our server.

This works:

print ("<img src=\"http://" . $user . ":" . $password . "@" . $ip . "/" . $filename . "\" alt=\"Webcam image from " . date("m-d-Y H:i:s") . "\" />\n");

But I'd like to grab the file for later saving/manipulating, and also avoid having the auth amd IP info in the HTML source - so I tried:

$camimage = fopen("http://" . $user . ":" . $password . "@" . $ip . "/" . $filename, "rb");

and it times out with:

Warning: fopen(http://...@69.9.5.12:84/IMAGE.JPG) [function.fopen]: failed to open stream: Connection timed out on line 24.

Anyone have any clue why? Is it the username/password that's the problem? The explicit port number? (I can't get around needing the authentication, but I might be able to redo to use port 80)