title: WriteAllBytes - Access to the path is denied
body: <p>I have pdf file as byte array inside myObject.PdfFile and I'm trying to save this inside hdd using write all bytes</p>
  
  <pre><code>System.IO.File.WriteAllBytes(@"C:\a.pdf", myObject.PdfFile);
  </code></pre>
  
  <p>using this I'm getting following exception</p>
  
  <blockquote>
    <p>{"Access to the path 'C:\a.pdf' is denied."}</p>
  </blockquote>
  
  <p>Should I first create a.pdf file and then to use or I'm missing something else.</p>