[SOLVED] Can anybody verify this? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- egsuh · 2021-02-21 05:38 I have a simple procedure, just sending a file stream to web server. But when there are any content in the stream, the server does not work --- respond 500 error. 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 // this is client-side procedure  procedure TForm1.Button2Click(Sender: TObject);var   httpclient: TFPHTTPClient;   astr, ss: TStringSTream;begin   // memo1.Clear;   httpClient:= TfpHttpClient.Create(nil);   astr:= TStringStream.Create(edit1.text);  // works if edit1.text = '', not with any text   ss:= TStringStream.Create;    httpclient.StreamFormPost('http://alphaq.codns.com/aq/aq03e',        'fieldname', 'filename', astr, ss);   showmessage(ss.DataString);   astr.free;   ss.free;end; //=========  server side  procedure TwmAQe.DataModuleRequest(Sender: TObject; ARequest: TRequest;   AResponse: TResponse; var Handled: Boolean);var  n: Integer;  f: TUploadedFile;  i: Integer;begin  n:= ARequest.Files.Count;  if n >= 1     then AResponse.Content:= 'file found'     else AResponse.Content:= 'no file';  handled:= True;end;  I wrote this in another thread, but at that time I thought the problem lies in the treatment of stream. Now I think this may be server-side problem. When there are no text, it will showmessage 'no file', but when there are any texts, then this shows 500 error.  Interestingly, I have tested these procedures a few months ago. Then, everything worked fine. I'd like to know whether this is replicable in other environments. Both client and server are running on windows 10. ---------------------------------------------------------------------- circular · 2021-02-21 05:45 Seems more like a server-side error. ---------------------------------------------------------------------- egsuh · 2021-02-21 06:39 QuoteSeems more like a server-side error. Yes. You are right. I found out the reason. Webserver could not write to "c:\windows\temp" directory. I could find this by setting host to localhost, not alphaq.codns.com.  alphaq.codns.com showed just 500 error, but localhost sent out something similar to  "failure to write to c:\windows\temp\CGI000~%...", so I set the privileges of that folder to read and write for users and iis_iusers. Still I don't know why suddenly this error happened. One possible reason may be the privileges might have been changed during auto- Windows upgrade or any other installation of applications, but not sure of course.