title: Know if a blob exists in a container from client side
body: <p>I need to know if a blob exists in a container from client side (jquery / js / or any other client framework)</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>I have a profile picture of a user in one of the containers of my azure blob storage. I show it on my webpage as follows</p>
  
  <pre><code>&lt;img class="profile pic" src="https://storageacc.blob.core.windows.net/container/empid/profile/pic" /&gt;
  </code></pre>
  
  <p>The image source is dynamically built during runtime. But there will be situations when the user has not uploaded his profile pic, so i need to show a blank profile pic. Means if the pic is uploaded by the user I will show pic.png else blank.png. </p>
  
  <p>So, when i load the page and the image source url is <em>built</em>, i need to know if the pic exists or not. I want this to happen at the client side. No posting ajax to c# ws to see if the pic  exists.</p>
  
  <p>One solution which comes to my mind is to maintain a flag in the database and set it to true when the profile pic is uploaded by the user, check that flag while building the image url and set <code>img</code> <code>src</code> accordingly. </p>
  
  <p>But I need to set the flag if the photo is uploaded, unset it if its removed. To avoid this and db intervention in the first place, do i have a solution for checking the image existence on Azure blob container from client side?</p>
  
  <p>Thanks in advance. </p>