【问题标题】:How can you, if even possible, Store binary image data within memcached?如果可能的话,您如何在 memcached 中存储二进制图像数据?
【发布时间】:2021-03-27 04:49:36
【问题描述】:

我正在开发一个程序来存储二进制图像数据,我决定将 memcached 用于缓存层。我实际上并没有收到任何错误,但是当我将二进制数据存储在其中时,它并不能正常工作。This is what the output of the array is , Look closely at where it says Profile_Pic, the value is just one character

        This is the code I use to update the memcaches array. Note that storing regular 
        values in memcached works fine.
        <?php $unit_array=$this->Memc->getByKey("Unit_Array_Casting_Server",$unit_name);
        $unit_array[$uuid][$keyname]=$keyvalue;
        $this->Memc->setByKey("Unit_Array_Casting_Server",$unit_name,$unit_array); ?>

【问题讨论】:

  • 你有没有试过在存储之前对二进制数据进行base64?
  • 是的,我有,但结果是一样的

标签: php image memcached


【解决方案1】:

没关系,原来问题是内部代码问题,我将 $keyvalue 变量作为数组输入,但事实并非如此。

【讨论】:

    猜你喜欢
    • 2016-09-06
    • 1970-01-01
    • 1970-01-01
    • 2013-11-22
    • 1970-01-01
    • 1970-01-01
    • 2020-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多