G
G
GennadyPHP2018-08-28 12:15:11
PHP
GennadyPHP, 2018-08-28 12:15:11

Why can't Imagick find the file?

Hello, I have this code:

$path = "public/content/".time().".png";
if(!empty($_POST['url']))
{
  file_put_contents($path, file_get_contents($_POST['url']));
}
echo '<img src="'.$path.'">';

- recording from the url goes fine, everything loads and the image is displayed, but after that Imagick starts working:
$imagick = new Imagick($path); // и тут ничего не работает, пишет, что не находит файл. если работать с $_FILES, то все работает, но загрузку по пути он не делает

Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2018-08-30
@GennadyPHP

Add __DIR__before the path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question