Answers.Body: <p>You missed a param to that function. The 4th param is attributes, which you can pass as an empty array, and the 5th param is required, which you can pass TRUE.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-19T14:56:08.840Z
Answers.Text: I added the array and it now gives me the following error when submitting: 
  
  "Please correct the following errors in the form fields below:
  Upload Image is a required field."
Answers.UserDisplayName: Sleewok
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-19T14:57:26.107Z
Answers.Text: ALSO, where can I find documentation on the attributes? I would like to specify the filename when uploading...
Answers.UserDisplayName: Sleewok
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-18T21:04:35.207Z
Answers.LastActivityDate: 2017-01-18T21:04:35.207Z
Answers.UserDisplayName: Coleman
Body: <p>I have created a form and I am trying to get an image to upload. I have the following set:</p>
  
  <pre><code>$this-&gt;add(
        'file', // field type
        'image_file', // field name
        'Upload Image', // field label      
        TRUE // is required
      );
  </code></pre>
  
  <p>However, when I submit the file it does not upload anywhere. Any ideas on what I am doing wrong?</p>
  
  <p>Thanks!</p>
  
Tags: <quickform><upload>
Title: Help with QuickForm Image Upload
ThreadText: # Help with QuickForm Image Upload
  
  (Asked by: username_0 on 2017-01-18)
  
  I have created a form and I am trying to get an image to upload. I have the following set:
  $this->add(
        'file', // field type
        'image_file', // field name
        'Upload Image', // field label      
        TRUE // is required
      );
  
  However, when I submit the file it does not upload anywhere. Any ideas on what I am doing wrong?
  Thanks!
  
  **Tags:** quickform, upload
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-01-18. Score: 2 | Accepted answer
  
  You missed a param to that function. The 4th param is attributes, which you can pass as an empty array, and the 5th param is required, which you can pass TRUE.
  
  > **Comments:**
  > **username_0**: I added the array and it now gives me the following error when submitting:   "Please correct the following errors in the form fields below: Upload Image is a required field."  
  > **username_0**: ALSO, where can I find documentation on the attributes? I would like to specify the filename when uploading...  
  
  ---
  
  