How do you display raw binary data of a file sent from a server with
curl ?
When I curl a movie file with curl -l -i "path2file/file.php",I get the
below output in my Terminal.
file.php:
$find = array($find1,$find2,$find3,$find4);
$replace = array($replace1,$replace2,$replace3,$replace4);
if( $fd = fopen($filepath, 'rb')){
while(!feof($fd)) {
echo str_replace($find,$replace, fread($fd, $chunkSize)); //read and
encode
}
fclose ($fd);
exit;
}
I want to encrypt the file with something akin to str_replace and
decode it on the other side with a custom data handler
Just want to make sure that I am str_replace'ing the actual data and
not a representation of it :)
I am am bit new to this and deep in experimentation so any help is
appreciated :)
g
--------------------
output:
ETag: 26a774b8e648b52c24f01c7277ce597f
Accept-Ranges: bytes
Content-Length: 24113190
Cache-Control: no-cache, must-revalidate
Content-Type: video/quicktime
ftypqt qt ??moovlmvhd????X-?@Tftrak\tkhd??s???-?@$edtselst-?S?mdia
mdhd?????D?:hdlrmhlrsounapplyApple Sound Media
HandlerS|minfsmhd9hdlrdhlralisappl?Apple Alias Data Handler$dinfdref
alisSstbl?stsd?mp4a???Dcwave
frmamp4a
mp4a3esds???"???@???????ostts:kNXstsc?
123?
56789:;?????????????????????????????????????????????????????????????????
???????????????????????????????????????