How can i send and jpg image from my server to my c# app?
<p>My server is running php and I want it to be able to send me images. For instance "profile.jpg".</p>

<p>In C# i just populate a bitmap image with the source, but how do I create a source, a file that outputs the images binary data?</p>

<p>I have this:</p>

<pre><code>&lt;?php
$file = 'profil.jpg';
$image = imagecreatefromjpeg($file);
imagealphablending($image, false);
imagesavealpha($image, true);

// start buffering
ob_start();
imagepng($image);
$contents =  ob_get_contents();
ob_end_clean();

echo "&lt;img src='data:image/jpeg;base64,".base64_encode($contents)."' /&gt;";

imagedestroy($image);
?&gt;
</code></pre>

<p>But it outputs HTML, could i just <code>echo base64_encode($contents)</code>?</p>
