You are not logged in.
Pages: 1
//-- This works fine
ContentLength := FileSize(FileName);
if ContentLength=0 then
begin
result := true;
exit;
end;
result := ContentLength <> 0;
if result and
(rfWantRange in ResponseFlags) then
if not ValidateRange then
result := false; // invalid offset
if not result then
// there is no such file available, or range clearly wrong
exit;
include(ResponseFlags, rfAcceptRange);
Output a file as a file stream
2.Mormot2 BUG Fix Please fix this unit mormot.net.http.pas
Methods: the function THttpRequestContext. ContentFromFile Bug reasons, the file is empty when the output is false, can not find a file, is wrong.
Amended as follows :
ContentLength := FileSize(FileName):// Add this judgment to this sentence:
if ContentLength=0 then
begin
result := true;
Pages: 1