C#
using (FileStream fs = File.OpenRead(path)) { this.Date = File.GetLastWriteTime(path); this.ContentLength = fs.Length; this.ContentType = mediaType; this.ChunkedTransferEncoding = false; _stream = new HTTPOutputStream(_session); Write(_stream); int rc; byte[] bytes = new byte[65536]; do { rc = fs.Read(bytes, 0, 65536); _stream.Write(bytes, 0, rc); } while (rc != 0); }Embedded http server project is taken from ;
http://www.codeproject.com/Articles/20445/C-Customizable-Embedded-HTTPServer?msg=4370868#xx4370868xx
Vithal WadjeRank #19 · 47.2K pointsPosted Mar 24, 2015, 10:04 AM EDT
kubilay bayraktar47 pointsPosted Mar 25, 2015, 12:20 AM EDT
kubilay bayraktar47 pointsPosted Mar 25, 2015, 12:57 AM EDT