title: Safari on iPhone set default image name as image.jpg on input type file input
body: <p>I've using CI 2.2 to made simple form with attachment/file upload. Everything working fine except on iphone safari browser. When people attach an image from iphone safari, the filename was turn into image.jpg. This causing problem where attachment from different person keep showing same image. </p>
  
  <p>I used filename encryption provided by CI but still no luck. </p>
  
  <p>Here is the model: </p>
  
  <ul>
  <li><p>function for take value from field:</p>
  
  <pre><code>   function check_field()
     {
       $ship_date = $this-&gt;input-&gt;post('date');
       $image_data = $this-&gt;upload-&gt;data();
       $field_data = [
         'ship_date'       =&gt; $ship_date,
          'ship_boxes'      =&gt; $this-&gt;input-&gt;post('boxes'),
          'ship_attach'     =&gt; $image_data['file_name'],
          'image_path'      =&gt; $image_data['file_path'],
          'ship_req_fund'   =&gt; $this-&gt;input-&gt;post('option'),
          'ship_amount_req' =&gt; $this-&gt;input-&gt;post('amount'),
          'ship_emp_id'     =&gt; $this-&gt;session-&gt;userdata('id')
       ];
  
       $this-&gt;db-&gt;insert('shipment', $field_data);
    }
  </code></pre>
  
  <ul>
  <li><p>attachment function      </p>
  
  <pre><code>function attachment()
  {
    $config['upload_path'] = 'uploads/';
    $config['allowed_types'] = 'gif|jpg|png|zip|rar|pdf';
    $config['max_size'] = '3000';
    $config['max_width'] = '2000';
    $config['max_height'] = '2000';
    $config['encrypt_name'] = true;
    $this-&gt;upload-&gt;initialize($config);
  }
  </code></pre></li>
  <li><p>sending message to email:</p>
  
  <pre><code>function send_message()
  {
  $config = [
      'protocol'  =&gt; 'mail',
      'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
      'smtp_port' =&gt; 465,
      'smtp_user' =&gt; '*******@gmail.com',
      'smtp_pass' =&gt; '*******',
      'mailtype'  =&gt; 'html',
      'charset'   =&gt; 'iso-8859-1',
      'wordwrap'  =&gt; TRUE
  ];
  
  $image_data = $this-&gt;upload-&gt;data();
  $image_link = $image_data['client_name'];
  
  $message = '&lt;h3&gt;Below is the shipment data you have submitted.&lt;/h3&gt;';
  $message .= '&lt;p&gt;&lt;b&gt;Shipment date&lt;/b&gt;: ' . $this-&gt;input-&gt;post('date') . '&lt;/p&gt;';
  $message .= '&lt;p&gt;&lt;b&gt;Number of boxes&lt;/b&gt;: ' . $this-&gt;input-&gt;post('boxes') . '&lt;/p&gt;';
  if($this-&gt;upload-&gt;data())
  {
     $message .= '&lt;p&gt;&lt;/b&gt;Attachment&lt;/b&gt;: &lt;a href="' . base_url() . 'uploads/' . $image_link . '"&gt;Click Here&lt;/a&gt;&lt;/p&gt;';
  }
  else
  {
      $message .= '&lt;p&gt;&lt;/b&gt;Attachment&lt;/b&gt;: No attachment&lt;/p&gt;';
  }
  if($this-&gt;input-&gt;post('option') == 1)
  {
      $message .= '&lt;p&gt;&lt;b&gt;Request fund&lt;/b&gt;: Yes&lt;/p&gt;';
      $message .= '&lt;p&gt;&lt;b&gt;Amount of funds requested&lt;/b&gt;: $' . $this-&gt;input-&gt;post('amount') . '&lt;/p&gt;';
  }
  else
  {
      $message .= '&lt;p&gt;&lt;b&gt;Request fund&lt;/b&gt;: No&lt;/p&gt;';
  }
  
  $this-&gt;email-&gt;initialize($config);
  $this-&gt;email-&gt;set_newline("\r\n");
  $this-&gt;email-&gt;from('*****@gmail.com', '*****');
  $this-&gt;email-&gt;to($this-&gt;session-&gt;userdata('email'));
  $this-&gt;email-&gt;subject('Shipment detail');
  $this-&gt;email-&gt;message($message);
  $this-&gt;email-&gt;send();
  }
  }
  </code></pre></li>
  </ul></li>
  </ul>
  
  <p>Any one meet same problem in the past or i have set it within wrong way? if this really caused by browser, any method to resolving the file upload in iphone safari? </p>
  
  <p>Thanks,</p>