xml文件无法下载到heroku文件夹

时间:2018-01-12 13:13:31

标签: php heroku codeigniter-3

我有一个简单的功能,可以得到一个" Blob"来自数据库的文件并尝试将其下载到heroku" collections"夹。它在我的本地计算机上工作,它接收blob文件并将其下载到我的本地目录,但同样的方法在Heroku中不起作用。

 public function downloadCollectionFiles(){
        $this->load->helper('file');           
        $root  = dirname(dirname(__FILE__));
        $root .= '/third_party/collections/';
        $this->load->model('invoice_page');

        $collectionData = $this->invoice_page->getCollectionTable();

        foreach($collectionData as $data){
            $invoiceName = 'xinvoices_xml'.'_'.date("Y-m-d").'_'.rand();  
            $paymentName ='updates_xml'.'_'.date("Y-m-d").'_'.rand();  
            if($data->invoice_xml){
                file_put_contents($root.$invoiceName.'.xml', $data->invoice_xml ); 
            }
            if($data->payment_xml){
                file_put_contents($root.$paymentName.'.xml', $data->payment_xml ); 
            }
           return true;    
    }

我尝试过疯狂的方法,但它不会在名为" collections"的heroku文件夹中下载该文件。 mysql将此字符串存储为blob。

0 个答案:

没有答案