protected function getStreamAsFile($stream)
    {
        // Get temporary file and name
        $file = tempnam(sys_get_temp_dir(), 'ssflysystem');
        $buffer = fopen($file, 'w');
        if (!$buffer) {
            throw new FlysystemException("Could not create temporary file");
        }

        // Transfer from given stream
        Util::rewindStream($stream);
        stream_copy_to_stream($stream, $buffer);
        if (!fclose($buffer)) {
            throw new FlysystemException("Could not write stream to temporary file");
        }

        return $file;
    }
protected function getStreamAsFile($stream)
    {
        // Get temporary file and name
        $file = tempnam(sys_get_temp_dir(), 'ssflysystem');
        $buffer = fopen($file, 'w');
        if (!$buffer) {
            throw new FlysystemException("Could not create temporary file");
        }

        // Transfer from given stream
        Util::rewindStream($stream);
        stream_copy_to_stream($stream, $buffer);
        if (!fclose($buffer)) {
            throw new FlysystemException("Could not write stream to temporary file");
        }

        return $file;
    }
protected function getStreamAsFile ( $ stream ) { // Get temporary file and name $ file = tempnam ( sys_get_temp_dir ( ) , 'ssflysystem' ) ; $ buffer = fopen ( $ file , 'w' ) ; if ( ! $ buffer ) { throw new FlysystemException ( "Could not create temporary file" ) ; } // Transfer from given stream Util :: rewindStream ( $ stream ) ; stream_copy_to_stream ( $ stream , $ buffer ) ; if ( ! fclose ( $ buffer ) ) { throw new FlysystemException ( "Could not write stream to temporary file" ) ; } return $ file ; }
Get stream as a file

@param resource $stream
@return string Filename of resulting stream content
@throws FlysystemException
Get stream as a file