Re: Binary file copy

From: Date: Thu, 16 Oct 2008 18:54:30 +0000
Subject: Re: Binary file copy
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-281995@lists.php.net to get a copy of this message
in the response you'll be getting the raw http response (including headers); so you're saving them as well thus not a valid image file. can't see why: $image = file_get_contents('http://10.10.10.3/record/current.jpg'); wouldn't work for you.. regardless though if you are using sockets, be sure to trim of that raw http response - oh and look out for chunked or encoded file transfer as well as you'll need to decode etc etc.. (large can of worms - use an http transport class)
file_get_contents worked beautifully. Thanks for the suggestion! Jay

« previous php.general (#281995) next »