S
S
Sergey Beloventsev2016-05-04 09:05:32
Yii
Sergey Beloventsev, 2016-05-04 09:05:32

How to upload an image from a link?

Is it possible to organize the download of a picture from a third-party site using a link to the picture, for example www.nokiaplanet.com/uploads/posts/2015-11/14488818... Here on this one.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rustamka Vorontsov, 2016-05-04
@Sergalas

1. Option
Option 2

$image = file_get_contents("http://site.ru/image.jpeg");
$save = file_put_contents('/path/to/image.jpeg', $image);

3. Option
if puff version >= 5.4 then image.intervention.io/getting_started/installation
and save
The advantages of 3 options are that it will be possible to change the dimensions, quality, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question