[SOLVED] Why a procedure does not operate suddenly? lazarus / 21-General ---------------------------------------------------------------------- egsuh · 2021-02-20 02:42 I have really strange problem.  Error occurs at the attached procedure, suddenly (used to work fine until a day ago). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function Taq_r_6.UploadQuestionnaire(tpid: string;DataSet:TDataSet): Boolean;var   AStrm: TStream;   AStrl : TStringList;begin   DataSet.First;   AStrm := TMemoryStream.Create;   AStrl := TStringList.Create;    {  // -- This is the original job. Used to work fine, but not working suddenly.           (DataSet as TBufDataSet).SaveToStream(AStrm);          // }    // Changing TStringList to a stream is for test purpose.    AStrl.Add('this'); // If comment out this line,  all works fine.  But with this line, causes error.    AStrl.SaveToStream(astrm);     Result := HttpPostFile(URL + 'SetDataSet', 'qdef', tpid, AStrm, AStrl);           // (URL, FieldName, FileName, Data, ResultData)    showmessage(astrl.text);    AStrl.Free;   AStrm.Free;end; If you go to http://alphaq.codns.com/aq/aq03e/SetDataSet,   you will see "SetDataSet called". So, the above function should display the same text by showmessage statement (the server does nothing but returning the string for now). This works fine when I add a stream of TStringList without any content. But when any string is added to the TStringList, it shows error message of Error 500. So there must be some problem in converting any content to stream. Funny thing is that I have been using this code (saving database file) without any problem for a few months. And it still works in lower verion (^^) of my program. What may be any possible reason, like changing charater set or other project options inadvertently? You may test this code yourself by replacing URL with "http://alphaq.codns.com/aq/aq03e/"  (which is followed by "SetDataSet", an action in webserver). p.s. HttpPostFile is a function from Ararat Synapse. So httpsend must present in the uses clause. ---------------------------------------------------------------------- egsuh · 2021-02-21 06:41 I found out the reason. Please refer to following thread. https://forum.lazarus.freepascal.org/index.php/topic,53400.0.html