0
    $result = $this->db->insert('user_reg', $user_data);
    if($result)
    {
       $userid = $this->db->insert_id();
       $this->db->where('user_id', $userid);
       $user_data =  $this->db->get('user_reg')->row();
       // $userid = $this->db->insert_id();

       chmod('./upload/', 0777);
       $path   = './upload/'.$userid;

       $binary=base64_decode($user_profile_img);

       header('Content-Type: bitmap; charset=utf-8');

       $img_path=$path.'/profile_image.jpg';

       $file = fopen($img_path, 'wb');

       fwrite($file, $binary);

       $Gimage = mysql_real_escape_string(base_url($path.'/profile_image.jpg'));

       fclose($file);

fcloseがバイナリを使用しているというエラーが表示されます誰でも解決策を知ることができます.ci更新機能で理解できません.他の内容を変更せずにテーブル内の画像パスを更新する必要があります.

4

1 に答える 1

0

ファイルが正しく作成されていることを確認する必要があります。次のチェックを追加してください。

if (!$file) die ('Error opening file for writing');

行の後:

$file = fopen($img_path, 'wb');

ここでメッセージが表示された場合は、生成されたファイル名と権限を確認してください。

于 2014-04-11T08:07:38.847 に答える