Body: <p>I planning to save the user submitted file in the civicrm file table.  I have tried these code to get the submitted file name, but it doesn't work</p>
  <pre><code>function postprocess(){
      $file = $this-&gt;_submitValues['uploadFile'];
      
  }
  </code></pre>
  <p>Any help would be appreciated!</p>
  <p>Update :</p>
  <p>This is my code, i can get the title, option value except the uploaded file name.where am i going wrong ??</p>
  <pre><code>function buildQuickForm() {
      $this-&gt;add('text', 'title', ts('Title'),'' ,TRUE);
      $this-&gt;add('File', 'uploadFile', ts('Upload the file'),  TRUE);
      $this-&gt;add('select', 'option', ts('option'),
        array(
          '0' =&gt; ts('- select -'),
          '3' =&gt; ts('option 1'),
          '4' =&gt; ts('option 2')
        ) 
      );
  
      $this-&gt;addButtons(array(
        array(
          'type' =&gt; 'submit',
          'name' =&gt; ts('Submit'),
          'isDefault' =&gt; TRUE,
        ),
      ));
    }
  
    function postprocess(){
  
      foreach($this-&gt;_submitValues as $key =&gt; $values){
        civi::log()-&gt;debug($key);
        civi::log()-&gt;debug($values);
      }
      
    }
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-30T10:19:59.333Z
Comments.Text: can you provide full code of the form?
Comments.UserDisplayName: Pradeep Nayak
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-30T12:18:45.900Z
Comments.Text: @PradeepNayak I updated, please see the updated question and suggest me a solution. Thank you!
Comments.UserDisplayName: safron
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-30T13:00:18.590Z
Comments.Text: @PradeepNayak please  help
Comments.UserDisplayName: safron
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-30T16:38:04.443Z
Comments.Text: Look at https://github.com/civicrm/civicrm-core/blob/master/CRM/Import/DataSource/CSV.php and see if that helps.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-01T17:47:32.137Z
Comments.Text: @Demerit unfortunately It's not. is there any way i could do it?? please help, I'm beginner to CiviCRM
Comments.UserDisplayName: safron
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-01T18:13:19.790Z
Comments.Text: @Demerit Currently I'm extending the CRM_Contact_Form_Task class, am i using the incorrect class??
Comments.UserDisplayName: safron
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-02T03:49:10.850Z
Comments.Text: @Demerit problem solved :)
Comments.UserDisplayName: safron
Tags: <files>
Title: How to save a file in civicrm file table?
ThreadText: # How to save a file in civicrm file table?
  
  (Asked by: username_0 on 2020-06-30)
  
  I planning to save the user submitted file in the civicrm file table.  I have tried these code to get the submitted file name, but it doesn't work
  function postprocess(){
      $file = $this->_submitValues['uploadFile'];
      
  }
  
  Any help would be appreciated!
  Update :
  This is my code, i can get the title, option value except the uploaded file name.where am i going wrong ??
  function buildQuickForm() {
      $this->add('text', 'title', ts('Title'),'' ,TRUE);
      $this->add('File', 'uploadFile', ts('Upload the file'),  TRUE);
      $this->add('select', 'option', ts('option'),
        array(
          '0' => ts('- select -'),
          '3' => ts('option 1'),
          '4' => ts('option 2')
        ) 
      );
  
      $this->addButtons(array(
        array(
          'type' => 'submit',
          'name' => ts('Submit'),
          'isDefault' => TRUE,
        ),
      ));
    }
  
    function postprocess(){
  
      foreach($this->_submitValues as $key => $values){
        civi::log()->debug($key);
        civi::log()->debug($values);
      }
      
    }
  
  **Tags:** files
  
  > **Comments:**
  > **username_1**: can you provide full code of the form?  
  > **username_0**: @PradeepNayak I updated, please see the updated question and suggest me a solution. Thank you!  
  > **username_0**: @PradeepNayak please  help  
  > **username_2**: Look at https://github.com/civicrm/civicrm-core/blob/master/CRM/Import/DataSource/CSV.php and see if that helps.  
  > **username_0**: @username_2 unfortunately It's not. is there any way i could do it?? please help, I'm beginner to CiviCRM  
  > **username_0**: @username_2 Currently I'm extending the CRM_Contact_Form_Task class, am i using the incorrect class??  
  > **username_0**: @username_2 problem solved :)  
  
  ---
  
  ## 0 answers
  
  