Answers.Body: <p>For security reasons, CiviCRM does not expose uploaded files directly, but routes them through a php script which checks permissions before fetching the image. If you know the file id and the event id, then you can construct the url yourself:</p>
  
  <p>yoursite.org?q=civicrm/file&amp;reset=1&amp;id=FILE_ID&amp;eid=EVENT_ID</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-28T12:18:59.393Z
Answers.Text: Is there a way to input the FILE_ID and EVENT_ID programically as for each event the uploaded picture would be different? Thanks in advance
Answers.UserDisplayName: pacusi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-28T13:15:34.003Z
Answers.Text: Of course you would need to use variables.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-18T10:47:18.647Z
Answers.Text: This is not right anymore, since a file hash is mandatory. See https://civicrm.stackexchange.com/questions/28754/get-url-of-custom-image-field
Answers.UserDisplayName: Philipp Michael
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-27T03:14:32.473Z
Answers.LastActivityDate: 2016-05-27T03:14:32.473Z
Answers.UserDisplayName: Coleman
Body: <p>I have currently created a custom field in CiviEvents to upload an image for my event. When viewing the eventinfo page I can see the image in a collapsible field which shows the thumbnail of the image and when I click on the image it enlarges in a popup box.</p>
  
  <p>All I need is the actual custom field url that point to the image so I can theme it correctly on my template.</p>
  
  <p>I've dug deep into the CustomDataView.tpl and come across {$element.field_value} but again this loads the custom field in the collapsible pane.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance</p>
  
Tags: <civievent><custom-fields>
Title: How to get url for custom image field
ThreadText: # How to get url for custom image field
  
  (Asked by: username_0 on 2016-05-22)
  
  I have currently created a custom field in CiviEvents to upload an image for my event. When viewing the eventinfo page I can see the image in a collapsible field which shows the thumbnail of the image and when I click on the image it enlarges in a popup box.
  
  All I need is the actual custom field url that point to the image so I can theme it correctly on my template.
  
  I've dug deep into the CustomDataView.tpl and come across {$element.field\_value} but again this loads the custom field in the collapsible pane.
  
  Any suggestions?
  
  Thanks in advance
  
  **Tags:** civievent, custom-fields
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-27. Score: 2 | Accepted answer
  
  For security reasons, CiviCRM does not expose uploaded files directly, but routes them through a php script which checks permissions before fetching the image. If you know the file id and the event id, then you can construct the url yourself:
  
  yoursite.org?q=civicrm/file&reset=1&id=FILE\_ID&eid=EVENT\_ID
  
  > **Comments:**
  > **username_0**: Is there a way to input the FILE_ID and EVENT_ID programically as for each event the uploaded picture would be different? Thanks in advance  
  > **username_1**: Of course you would need to use variables.  
  > **username_2**: This is not right anymore, since a file hash is mandatory. See https://civicrm.stackexchange.com/questions/28754/get-url-of-custom-image-field  
  
  ---
  
  