Answers.Body: <p>You can use <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/" rel="nofollow noreferrer">validateForm</a> in an extension to restrict it.</p>
  <p>You can also vote for this ticket: <a href="https://lab.civicrm.org/dev/core/-/issues/2410" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/2410</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-09T04:26:35.190Z
Answers.Text: Although it didn't directly fix my problem but this helped me get the idea how to fix it.. thanks
Answers.UserDisplayName: Kurogami Dono
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-08T13:38:48.153Z
Answers.LastActivityDate: 2021-03-08T13:38:48.153Z
Answers.UserDisplayName: Demerit
Body: <p>I have created a file type custom field and discovered that you can upload any type of file on the field so I want to restrict the custom field to only upload image files. Is it possible?</p>
  
Tags: <custom-fields><custom>
Title: File type custom field to only allow images
ThreadText: # File type custom field to only allow images
  
  (Asked by: username_0 on 2021-03-08)
  
  I have created a file type custom field and discovered that you can upload any type of file on the field so I want to restrict the custom field to only upload image files. Is it possible?
  
  **Tags:** custom-fields, custom
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-08. Score: 2 | Accepted answer
  
  You can use [validateForm](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/) in an extension to restrict it.
  
  You can also vote for this ticket: <https://lab.civicrm.org/dev/core/-/issues/2410>
  
  > **Comments:**
  > **username_0**: Although it didn't directly fix my problem but this helped me get the idea how to fix it.. thanks  
  
  ---
  
  