Body: <p>I'm using Drupal with CiviCRM 4.7.30 (but this issue also affected 4.6) on Nginx &amp; Debian </p>
  
  <p>I have a custom field used for images. Images are uploaded and stored correctly (when copying the image directly from the server it looks good), but when viewed or downloaded via /civicrm/file? the image is broken.</p>
  
  <p>Using a hex viewer to inspect the files I've found that CiviCRM is adding '0A0A' to the start of the file (see attached screenshot)</p>
  
  <p><a href="https://i.sstatic.net/He6kO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/He6kO.png" alt="screenshot of hex viewer showing 0A0A"></a></p>
  
  <p>Has anyone experienced this? Could this be an Nginx or Php issue rather than Civi?</p>
  
  <p>thanks,
  L</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-22T09:16:08.930Z
Comments.Text: You state both CiviCRM versions have the same problem. Probably something in de used technology stack like PHP and Nginx. Maybe you can add the versions. Another test is trying to recreate the problem on the CiviCRM test server http://dmaster.demo.civicrm.org/ .
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-22T12:07:46.297Z
Comments.Text: The issue did begin after a point release upgrade for 4.6, and I held out hope moving to 4.7 would fix it. I will do a bit more server digging and update this question if I find anything
Comments.UserDisplayName: Leckie
Tags: <custom-fields><images><files>
Title: Images uploaded as custom fields are broken on view/download
ThreadText: # Images uploaded as custom fields are broken on view/download
  
  (Asked by: username_0 on 2018-03-21)
  
  I'm using Drupal with CiviCRM 4.7.30 (but this issue also affected 4.6) on Nginx & Debian
  
  I have a custom field used for images. Images are uploaded and stored correctly (when copying the image directly from the server it looks good), but when viewed or downloaded via /civicrm/file? the image is broken.
  
  Using a hex viewer to inspect the files I've found that CiviCRM is adding '0A0A' to the start of the file (see attached screenshot)
  
  [![screenshot of hex viewer showing 0A0A](https://i.sstatic.net/He6kO.png)](https://i.sstatic.net/He6kO.png)
  
  Has anyone experienced this? Could this be an Nginx or Php issue rather than Civi?
  
  thanks,
  L
  
  **Tags:** custom-fields, images, files
  
  > **Comments:**
  > **username_1**: You state both CiviCRM versions have the same problem. Probably something in de used technology stack like PHP and Nginx. Maybe you can add the versions. Another test is trying to recreate the problem on the CiviCRM test server http://dmaster.demo.civicrm.org/ .  
  > **username_0**: The issue did begin after a point release upgrade for 4.6, and I held out hope moving to 4.7 would fix it. I will do a bit more server digging and update this question if I find anything  
  
  ---
  
  ## 0 answers
  
  