I'm using CakePHP 3.2 and proffer plugin to upload images and generate thumbnails.
Proffer plugin is working fine with images selected from input field type file
.
Now, I have a separate directory with images say products
on the server and and image in it say my_image.jpg
I have to pass this image via proffer upload same as using the form. Only difference is instead of selecting an image from form, I'm taking it from a directory.
my image path is like
$full_image_path = '/products/my_image.jpg';
and saving it like
$productImage = $this->ProductImages->patchEntity($productImage, [
'image' => $full_image_path,
'product_id' => 1
]);
$this->ProductImages->save($productImage);
But this is giving error as
Illegal string offset 'tmp_name'
How can i get and pass tmp_name
of image ?