JavaLikeCalc.JavaScript
if(HTTPreq != "GET") { rez = ""; return; }

offPath = 0; url.parsePath(0, 0, offPath);
reqF = url.slice(offPath);
if(!(fSz=SYS.fileSize(baseD+reqF)))	{
	page = "<center><h1>The file '%1' not found!</h1></center>".replace("%1", reqF);
	HTTPvars["Content-Type"] = "text/html;charset=UTF-8";
	rez = "404 Not Found";
	return;
}

HTTPvars["Content-Type"] = SYS.UI.mimeGet(reqF);

fSzLim = max(10e3, fSzSolidLim);	//File's block size for reading

//Range at request
if(HTTPvars["Range"] != null) {
	tVl = HTTPvars["Range"].parse(1, "bytes=");
	fOff = tVl.parse(0,"-").toInt();
	if((tVl=tVl.parse(1,"-")).toInt())	fSzLim = tVl.toInt() - fOff + 1;

	page = SYS.fileRead(baseD+reqF, fOff, fSzLim);
	HTTPvars["Content-Range"] = "bytes "+fOff+"-"+(fOff+page.length-1)+"/"+fSz;
	rez = "206 Partial Content";
}
//By chunks with direct writing
else if(fSz > fSzLim) {
	tr.writeTo(sender, prt.pgCreator("","200 OK",
			"Content-Type: "+HTTPvars["Content-Type"]+"\x0D\x0ATransfer-Encoding: chunked"));
	for(fOff = 0; fOff < fSz; fOff += page.length) {
		page = SYS.fileRead(baseD+reqF, fOff, fSzLim);
		tr.writeTo(sender, page.length.toString(16)+"\x0D\x0A"+page+"\x0D\x0A");
	}
	tr.writeTo(sender, "0\x0D\x0A\x0D\x0A");
	rez = "";
}
//Simple data in single package
else { page = SYS.fileRead(baseD+reqF); rez = "200 OK"; }