dimanche 4 août 2019

Error in uploading image to server in laravel and php

I have some code which is used to put file in folder.But it shows undefined. The code is as follows:

    $path = public_path() . "/products/original/" . $this->image_name;

    $img = substr($this->base64Image, strpos($this->base64Image, ",")+1);

    $data = base64_decode($img);
    //return true;
    $success = file_put_contents($path, $data);
    if($success)
    {
        return true;
    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire