Answers.Body: <p>If your images are being stored in a directory that prohibits direct access, it will give you that symptom. There's a .htaccess file that performs this function for apache, I'm not sure how that works with MS servers.</p>
  
  <p>Your best bet is to try loading the image directly (e.g. right click on the broken image and load the image in a new tab) and see what the path/url is, and look in your server logs, it should tell you why that image is not being loaded, i.e. either whether it is a permission or just a not-found issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-22T07:21:11.973Z
Answers.Text: Hi Alan. Thanks for that. I am looking at the path and URL and they match. The only difference is the directory uses the C:// as the directory path and the image url upload uses the domain name. The image uploads successfully, I can see it in the KCfinder and also on the server. However, when I try to hit the URL it shows a not found. I understand it might be a permissions problem - just thinking what to do next.
Answers.UserDisplayName: Sohal Khatwani
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-22T08:17:11.447Z
Answers.Text: I did a bit more work and it seems like it is possibly a windows permission issue. However, it is not a simple read or write permissions issues and I am trying to work through it systematically. The system creates a new group and when you click on the group and edit its permission the images and files work. However, when a new image is uploaded it does not work again. Any ideas would be great.
Answers.UserDisplayName: Sohal Khatwani
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-23T18:48:18.693Z
Answers.Text: Windows permissions is out of my interest unfortunately. If it's anything like linux/unix permissions, you just need to figure out how to get uploaded images into your group automatically. Sounds like a security feature that would be a problem for any uploaded file/image for your site.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-24T00:50:44.820Z
Answers.Text: Thanks Alan for your hep. It gave me some good ideas to work through the issue. I have resolved it. I will answer this question.
Answers.UserDisplayName: Sohal Khatwani
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-20T15:25:16.533Z
Answers.LastActivityDate: 2016-12-20T15:25:16.533Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>The answer to this issue is in the PHP uploads which needs to match the directory upload url. When a file is uploaded via CiviCRM it goes to the temp folder (same like Drupal) and then moves the file to the permanent folder after it has been fully uploaded. If the temp folder and php temp folder do not match exactly then the image will appear broken on the screen. This video actually gave me the idea of a solution - <a href="https://www.youtube.com/watch?v=Wrr-dTFfNi8" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Wrr-dTFfNi8</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-24T01:09:00.503Z
Answers.LastActivityDate: 2016-12-24T01:09:00.503Z
Answers.UserDisplayName: Sohal Khatwani
Body: <p>I have been working with CiviMail to upload images directly to the mailing templates from the KC finder image upload. I am successfully able to upload an image via KC finder which looks good when I upload it. However, once I click away to add the image to the template it shows a big red x instead of the actual image. I understand that it might be a permissions issues but I have tried different options for the issue and it does not work. This CiviCRM is on a Windows 2012 server with IIS 8.5 and PHP 5.6.20. I have tried a number of options from not naming the images with dashes to permissions of the server. </p>
  
  <p><a href="https://i.sstatic.net/8cM8r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8cM8r.png" alt="enter image description here"></a> <a href="https://i.sstatic.net/JNdrc.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JNdrc.png" alt="enter image description here"></a></p>
  
Tags: <civimail><images>
Title: CiviMail Images always appear broken on screen after uploading correctly
ThreadText: # CiviMail Images always appear broken on screen after uploading correctly
  
  (Asked by: username_0 on 2016-12-20)
  
  I have been working with CiviMail to upload images directly to the mailing templates from the KC finder image upload. I am successfully able to upload an image via KC finder which looks good when I upload it. However, once I click away to add the image to the template it shows a big red x instead of the actual image. I understand that it might be a permissions issues but I have tried different options for the issue and it does not work. This CiviCRM is on a Windows 2012 server with IIS 8.5 and PHP 5.6.20. I have tried a number of options from not naming the images with dashes to permissions of the server.
  
  [![enter image description here](https://i.sstatic.net/8cM8r.png)](https://i.sstatic.net/8cM8r.png) [![enter image description here](https://i.sstatic.net/JNdrc.png)](https://i.sstatic.net/JNdrc.png)
  
  **Tags:** civimail, images
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2016-12-20. Score: 1
  
  If your images are being stored in a directory that prohibits direct access, it will give you that symptom. There's a .htaccess file that performs this function for apache, I'm not sure how that works with MS servers.
  
  Your best bet is to try loading the image directly (e.g. right click on the broken image and load the image in a new tab) and see what the path/url is, and look in your server logs, it should tell you why that image is not being loaded, i.e. either whether it is a permission or just a not-found issue.
  
  > **Comments:**
  > **username_0**: Hi Alan. Thanks for that. I am looking at the path and URL and they match. The only difference is the directory uses the C:// as the directory path and the image url upload uses the domain name. The image uploads successfully, I can see it in the KCfinder and also on the server. However, when I try to hit the URL it shows a not found. I understand it might be a permissions problem - just thinking what to do next.  
  > **username_0**: I did a bit more work and it seems like it is possibly a windows permission issue. However, it is not a simple read or write permissions issues and I am trying to work through it systematically. The system creates a new group and when you click on the group and edit its permission the images and files work. However, when a new image is uploaded it does not work again. Any ideas would be great.  
  > **username_1**: Windows permissions is out of my interest unfortunately. If it's anything like linux/unix permissions, you just need to figure out how to get uploaded images into your group automatically. Sounds like a security feature that would be a problem for any uploaded file/image for your site.  
  > **username_0**: Thanks Alan for your hep. It gave me some good ideas to work through the issue. I have resolved it. I will answer this question.  
  
  ---
  
  ### Answer by username_0 on 2016-12-24. Score: 0
  
  The answer to this issue is in the PHP uploads which needs to match the directory upload url. When a file is uploaded via CiviCRM it goes to the temp folder (same like Drupal) and then moves the file to the permanent folder after it has been fully uploaded. If the temp folder and php temp folder do not match exactly then the image will appear broken on the screen. This video actually gave me the idea of a solution - <https://www.youtube.com/watch?v=Wrr-dTFfNi8>
  
  
  ---
  
  