2011-02-07 3 views
1

からファイルを添付します。それは私はクロスドメインセキュリティの問題のために仮定している添付しません。 CodeIgniterを使用して私が制御できる別のサーバのファイルをどのように添付できますか?CodeIgniterのは - 私はCodeIgniterのを使用して、私のCDNから引っ張って使用して私のウェブサイトからのファイルを添付しようとしているCDN


$this->load->helper('email'); 

$this->email->from('[email protected]'); 
$this->email->to($this->input->post('email')); 

$retval = $this->crud_model->read('posts', $post_id); 
$post = $retval[0]; 

$this->email->subject($post->title); 
$this->email->message('Location: '.$this->config->item('cdn_media_url').$post->image_path); 
$this->email->attach($this->config->item('cdn_media_url').$post->image_path); 

ありがとうございます。

答えて

2

HTTPロケーションヘッダーとURLを電子メールに添付することはできません。それだけでは意味がありません。

file_get_contentsまたはcURLでCDNからイメージをダウンロードすると、コード内のサーバーにローカルパスを提供できます。

関連する問題