程序666猿 2015-06-12 11:57 采纳率: 0%
浏览 1646

(Thinkphp),在sae上怎样将字符串生成文本文件放到storage上啊?

主要就是想在storage中将字符串内容生成文件,用file_put_contents('saemc://xxx)函数可以生成,但这样就破坏了可移植的规则啊。
有没有别的什么函数可以操作啊?
还有就是,如果我将sae中的storage设置为private私有,就不能直接访问其中文件了,那个access key 和secret key怎么用啊?看了半天api文档,也不知道怎么一回事

  • 写回答

1条回答 默认 最新

  • 陌里红尘 2015-06-12 13:54
    关注

    SaeStorage使用说明

    下面是一个小的demo

      $domain = 'xhprof';
        $fileName = 'test.txt';     
        if ($storage->fileExists($domain,$fileName)){
            $res = $storage->read($domain,$fileName);
        }
        $content = "aaaa";
        $storage->write($domain,$fileName,$content);
    
    评论

报告相同问题?