AppEngine PHP read and write blob to datastore

别说谁变了你拦得住时间么 提交于 2019-12-25 05:59:08

问题


The Google AppEngine PHP API provides a way to read and write to a blob.

  public function setBlobValue($blobValue)
  {
    $this->blobValue = $blobValue;
  }
  public function getBlobValue()
  {
    return $this->blobValue;
  }

However this doesn't seem to work when writing / reading an html string stored in a blob, e.g.

$string = "<div>Test</div>"
$obj->setBlobValue(base64_encode($string));

then after a query:

$string = base64_decode($obj->getBlobValue());

doesn't work - is there something I'm doing wrong here?

(note this would be used to store much larger strings than the example here)

来源:https://stackoverflow.com/questions/31313381/appengine-php-read-and-write-blob-to-datastore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!