title: Embedd Images from MongoDB gridFS into my HTML-Page
body: <p>I saved some files via MongoDBs gridFS into my database.
  I know how to retrieve files just with php in my browser:</p>
  
  <pre><code>header('Content-type: '.$object-&gt;file['filetype']);
  echo $object-&gt;getBytes();
  </code></pre>
  
  <p>That works perfectly fine. But I now wan't to put the image in a context.</p>
  
  <p>e.g.</p>
  
  <pre><code>&lt;img&gt;&lt;?php echo $object-&gt;getBytes(); ?&gt;&lt;/img&gt;
  </code></pre>
  
  <p>If I put the code</p>
  
  <pre><code>echo $object-&gt;getBytes();
  </code></pre>
  
  <p>in a htmlpage, I just get the image like this:</p>
  
  <blockquote>
    <p>����JFIFHH��C !"$"$��C���Y"�� ��O!"12AQaq�BR��#b��3Cr��$S����4���%cs�5&amp;��DT�������&amp;!1A"Q2q�#Ba��?�( �#�EUDDUU�#��(�?2� ��.h#k���.��d�M���(��=�]��Nk��E�gZz�GI�Вr��<em>�~+x������&lt;{YZSm�n�N I�DAmDU��</em>����G���U:���H�6J̺'!lV�������D:H2��S��7��U;����7����������n��wV$�ʞ�i|��wP����?Qx۾�/�K'�:=���i�E�0)�E��4OU�G�W��`t] �������.�j��='�/�:9�V����봺a_}2����a_�D��J[r�J���<em>f�6�B&lt;���ѿc���=8�Q��1!("��B���⅝4&lt;#��L���K�Iy</em>�"���?�6�6�a7�k����%�F6�y��� v��</p>
  </blockquote>
  
  <p>and so on...</p>
  
  <p>does anybody know how I can embedd an image into a website???</p>
  
  <p>Thanks</p>