src/CloudinaryAdapter.php
public function write($path, $contents, Config $config)
    {

        // 1. Save to temporary local file -- it will be destroyed automatically
        $tempfile = tmpfile();
        fwrite($tempfile, $contents);

        // 2. Use Cloudinary to send
        $uploaded_metadata = $this->writeStream($path, $tempfile, $config);

        return $uploaded_metadata;
    }
public function write($path, $contents, Config $config)
    {

        // 1. Save to temporary local file -- it will be destroyed automatically
        $tempfile = tmpfile();
        fwrite($tempfile, $contents);

        // 2. Use Cloudinary to send
        $uploaded_metadata = $this->writeStream($path, $tempfile, $config);

        return $uploaded_metadata;
    }
public function write ( $ path , $ contents , Config $ config ) { // 1. Save to temporary local file -- it will be destroyed automatically $ tempfile = tmpfile ( ) ; fwrite ( $ tempfile , $ contents ) ; // 2. Use Cloudinary to send $ uploaded_metadata = $ this -> writeStream ( $ path , $ tempfile , $ config ) ; return $ uploaded_metadata ; }
Write a new file.
Create temporary stream with content.
Pass to writeStream.

@param string $path
@param string $contents
@param Config $config   Config object

@return array|false false on failure file meta data on success
Write a new file . Create temporary stream with content . Pass to writeStream .