1

In javascript I've managed to get the browser to generate a blob image as a url like this 'blob:http://localhost:8000/46f8dec5-203e-442c-b27a-89d1758381ae' and you can see the image

How do I save this data as an image on the server because when I use the code below it generates an image file but the file is corrupted and the image can't display.

file_put_contents($file, 'blob:http://localhost:8000/46f8dec5-203e-442c-b27a-89d1758381ae');

I've tried using just the url like this http://localhost:8000/46f8dec5-203e-442c-b27a-89d1758381ae and just the binary data 46f8dec5-203e-442c-b27a-89d1758381ae

ONYX
  • 5,679
  • 15
  • 83
  • 146
  • I am sorry to break it to you, but that is not an image. If there is an image stored at that location, you could do : `file_put_contents($file, file_get_contents('http://localhost:8000/.......'));` – Kraang Prime Jan 06 '17 at 02:42
  • I tried that and that still won't work – ONYX Jan 06 '17 at 02:48
  • What I see on that URL is what appears to be a GUID. The contents of that page are really up for question. One can not simply echo out binary data then retrieve it as ascii. – Kraang Prime Jan 06 '17 at 02:54
  • http://stackoverflow.com/a/6710414/4621324 – Axalix Jan 06 '17 at 04:23

0 Answers0