[
  {
    "Id": "1097538",
    "ThreadId": "458692",
    "Html": "Hi all,\r<br />\n<br />\nI am using the following code to zip a file. this is for mimetype of epub file. When i check the file in epub validator, it shows the error &quot;Mimetype file should contain only the string &quot;application/epub+zip&quot;.&quot;. So i checked the file using a hex editor and found the mimetype contains the following string. \r<br />\n&quot;ï»¿application/epub+zip..&quot;\r<br />\nmoreover it should contains 20 byte length and my mimetype is 25 byte length. Additional 3 char at beginning and 2 char at end are added to my string.\r<br />\nCan anyone help me to sort out this issue?<br />\n",
    "PostedDate": "2013-09-21T23:36:12.82-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "1097539",
    "ThreadId": "458692",
    "Html": "Following is the code i used\r<br />\n<br />\nusing (MemoryStream ms = new MemoryStream())<br />\n<pre><code>    {\n        //content of the file is static and is used here directly\n        using (StreamWriter w = new StreamWriter(ms, Encoding.UTF8))\n        {\n            w.WriteLine(&quot;application/epub+zip&quot;);\n        }\n        using (ZipFile zip = new ZipFile())\n        {\n            MemoryStream msMimetype = new MemoryStream(ms.ToArray());\n            msMimetype.Seek(0, SeekOrigin.Begin);\n\n            zip.Encryption = Ionic.Zip.EncryptionAlgorithm.None;\n            zip.EmitTimesInUnixFormatWhenSaving = false;\n            zip.EmitTimesInWindowsFormatWhenSaving = false;                    \n            zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Never;\n            zip.CompressionMethod = Ionic.Zip.CompressionMethod.None;\n            zip.CompressionLevel = Ionic.Zlib.CompressionLevel.None;\n\n            zip.AddEntry(&quot;mimetype&quot;, msMimetype);\n\n\n            zip.Save(System.IO.Path.GetTempPath() + &quot;\\\\&quot; + FileName);\n        }</code></pre>\n\n}<br />\n",
    "PostedDate": "2013-09-21T23:39:11.8-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]