I'm looking to understand how civicrm manages files/images. After upgrading to 4.5 image handling changed, then 4.6 it seemed to change again. Many people are focused on contact images, however I'm more focused on event images. The latter makes a site much richer.
In the "old" days, a file would be placed in the custom/upload folder and a URL would access it (e.g. civicrm/file/custom/image.jpg. Then civicrm started handling images/files internally and the url resolves the storage location.
I have seen literally dozens of issues/questions on this topic. I'm looking for any "official" documentation for file and image handling. There are many moving parts including the civicrm file/image handler and .htaccess rules. It's been really tricky (for me) to figure out.
Joe Murray, documented here CRM_Utils_System::url: https://issues.civicrm.org/jira/browse/CRM-14499
For images, CRM_Utils_System::url('civicrm/file/imagefile','id={fileID}&eid={entity_id}', TRUE,FALSE,FALSE,TRUE) will provide the image url for front end use. Remove 'imagefile' for other files.
For reference there is some discussion here: http://forum.civicrm.org/index.php/topic,34929.0.html and https://issues.civicrm.org/jira/browse/CRM-16009
and lot's in jira: https://issues.civicrm.org/jira/issues/?jql=text%20~%20%22image%20url%22