title: RavenDB Attachments - Functionality how to do?
body: <p>I have a file input control.</p>
  
  <pre><code>   &lt;input type="file" name="file" id="SaveFileToDB"/&gt;
  </code></pre>
  
  <p>Lets say I browse to <strong>C:/Instruction.pdf</strong> document and click on submit. On Submit, I want to save the document in RavenDB and also later retrieve it for download purposes. I saw this link <a href="http://ravendb.net/docs/client-api/attachments" rel="noreferrer">http://ravendb.net/docs/client-api/attachments</a>
  that says.. do this..</p>
  
  <pre><code>Stream data = new MemoryStream(new byte[] { 1, 2, 3 }); 
  
  documentStore.DatabaseCommands.PutAttachment("videos/2", null, data,
    new RavenJObject {{"Description", "Kids play in the garden"}});
  </code></pre>
  
  <p>I am not following what 1,2,3 mean here and what it means to say videos/2 in the command... how I can use these two lines to use it in my case.. to save word/pdfs in ravendb.. if any one has done such thing before, please advise. </p>
  
  <p>I am not clear on one thing.. how the attachment is stored. If I want to store the attachment itself (say pdf) it is stored independently in ravendb.. and I just store the key of the attachment in the main document that it is associated with? If that is so, where is the pdf stored physically in ravendb? can I see it?</p>