public static function createFromData($data, $destination, $mimeType, $filename = '')
    {
        $tmp = tempnam('/tmp', 'qtism');
        file_put_contents($tmp, $data);

        $file = self::createFromExistingFile($tmp, $destination, $mimeType, $filename);
        unlink($tmp);

        return $file;
    }
public static function createFromData($data, $destination, $mimeType, $filename = '')
    {
        $tmp = tempnam('/tmp', 'qtism');
        file_put_contents($tmp, $data);

        $file = self::createFromExistingFile($tmp, $destination, $mimeType, $filename);
        unlink($tmp);

        return $file;
    }
public static function createFromData ( $ data , $ destination , $ mimeType , $ filename = '' ) { $ tmp = tempnam ( '/tmp' , 'qtism' ) ; file_put_contents ( $ tmp , $ data ) ; $ file = self :: createFromExistingFile ( $ tmp , $ destination , $ mimeType , $ filename ) ; unlink ( $ tmp ) ; return $ file ; }
Create a File from existing data.

@param string $data
@param string $destination
@param string $mimeType
@param string $filename
@return \qtism\common\datatypes\files\FileSystemFile
Create a File from existing data .