Php - How to save a wordpress.com dynamically generated image to the server

370 Views Asked by At

Wordpress.com offers a service that allows to generate a website snapshot on the fly using url formed like this example:

https://s.wordpress.com/mshots/v1/http%3A%2F%2Fnytimes.com?w=612

I tried with copy

copy('https://s.wordpress.com/mshots/v1/http%3A%2F%2Fnytimes.com?w=612',/local/path/file.jpg);

But it doesn't work. Also, if I put a static image as copy first parameter the command works.

What am I missing?

1

There are 1 best solutions below

0
Matt Backslash On

You want to save an image from an URL to your server?

save an image from a URL then save it into a directory php