Skip to content

Instantly share code, notes, and snippets.

@megasaturnv
Created January 16, 2018 14:52
Show Gist options
  • Save megasaturnv/fe8bbd9f54fec30b22a913ab549bcbaf to your computer and use it in GitHub Desktop.
Save megasaturnv/fe8bbd9f54fec30b22a913ab549bcbaf to your computer and use it in GitHub Desktop.
Download and display image from remote webpage. No temp file. Image in <img> tag
<?php //Megasaturnv 2018-01-16 Use curl -u username:password for http auth if required ?>
<img src="data:image/jpeg;base64, <?php echo base64_encode(shell_exec("curl http://192.168.1.50/cgi-bin/snapshot.cgi?channel=0 2> /dev/null")) ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment