title: Broken response from Raspberry Pi server when GETting stored images
body: <p>I have a Raspberry Pi server which has PNG images saved on it. I am trying to GET the images from the server and append them all to an HTML element. All of the relevant files (the images, HTML, JavaScript, and PHP) are all stored in <code>/var/www/html</code>.</p>
  <h3>File <code>load.php</code>:</h3>
  <pre><code>&lt;?php
  $dirname = &quot;/var/www/html/&quot;;
  $images = glob($dirname.&quot;*.png&quot;);
  $data = '&lt;ul&gt;';
  foreach($images as $image) {
    $data .= '&lt;li&gt;&lt;img src=&quot;'.$image.'&quot; /&gt;&lt;/li&gt;'; // append all images
  }
  $data .= '&lt;/ul&gt;';
  echo $data;
  ?&gt;
  </code></pre>
  <p>JavaScript function:</p>
  <pre><code>function loadImg(){
      $.ajax({
          type: &quot;GET&quot;,
          url: &quot;load.php&quot;,
          success: function(data){
              console.log(data); // To check something there
              $(&quot;#imgsDiv&quot;).html(data);
          }
      });
  }
  </code></pre>
  <p>However, this functionality does not work and only displays the traditional broken image icon onto the 'imgsDiv'.</p>
  <p>I really have no idea why it can't display the images from the server. It is not an issue with folder permissions as I am able to load single named images into img srcs.</p>
  <p>This is the HTML when I inspect the page:</p>
  <p><a href="https://i.stack.imgur.com/ReRyV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ReRyV.png" alt="Enter image description here" /></a></p>
  <p>I also get a 404 error saying that the page can't find the resource: <a href="http://192.168.1.201/var/www/html/image.png" rel="nofollow noreferrer">http://192.168.1.201/var/www/html/image.png</a>, etc. for all of the listed images.</p>