title: Not deleting existing file
body: <p>If the file exist, I want to delete it first then write the file. here is the code:</p>
  
  <pre><code>try
  {
      if (File.Exists("qwe.mp4"))
      {
          File.Delete("qwe.mp4");
      }
      File.WriteAllBytes("qwe.mp4", encodedDataAsBytes);                   
  }
  </code></pre>
  
  <p>however, when i run the program, it does not delete the existing but it append the previous data to the next. (the first data only 2 sec and after append new data, it gets 4 sec). yet the new data cannot be read meaning it only can be played first 2 sec and the other 2 sec cannot be read. </p>
  
  <p>how should i solve this? i want delete the existing file permanently and create a new file with a new data.</p>