You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a very strange bug - it only manifests itself under our ISAPI application running on IIS (Windows Server) but not on IIS (Windows 10 professional)
Anyway, making a call to TJsonBaseObject.ParseFromFile returns nil in the error case.
Changing the implementation code as below fixes the problem and the text is parsed correctly into a JSON object.
class function TJsonBaseObject.ParseFromFile(const FileName: string; Utf8WithoutBOM: Boolean{$IFDEF SUPPORT_PROGRESS}; AProgress: PJsonReaderProgressRec{$ENDIF}): TJsonBaseObject;
var
Stream: TFileStream;
begin
Stream := TFileStream.Create(FileName, fmOpenRead or fmShareDenyWrite);
try
// add this line
Stream.Seek(0, soBeginning);
Result := ParseFromStream(Stream, nil, Utf8WithoutBOM{$IFDEF SUPPORT_PROGRESS}, AProgress{$ENDIF});
finally
Stream.Free;
end;
end;
The text was updated successfully, but these errors were encountered:
This is a very strange bug - it only manifests itself under our ISAPI application running on IIS (Windows Server) but not on IIS (Windows 10 professional)
Anyway, making a call to TJsonBaseObject.ParseFromFile returns nil in the error case.
Changing the implementation code as below fixes the problem and the text is parsed correctly into a JSON object.
The text was updated successfully, but these errors were encountered: