TsgcWebSocketHTTPServerEvents › OnHTTPUploadReadInput

OnHTTPUploadReadInput Event

Fires when the multipart/form-data decoder reads a non-file input field so its value can be captured.

Syntax

property OnHTTPUploadReadInput: TsgcWSHTTPUploadReadInputEvent;
// TsgcWSHTTPUploadReadInputEvent = procedure(Sender: TObject; const aName, aValue: string) of object

Default Value

Remarks

OnHTTPUploadReadInput is raised for every form field in a multipart/form-data body that is not a file upload (plain <input> values, text areas...). aName carries the field name and aValue the decoded value; use the pair to populate a metadata record that accompanies the files received through OnHTTPUploadBeforeSaveFile / OnHTTPUploadAfterSaveFile. Requires HTTPUploadFiles.StreamType = pstFileStream with HTTPUploadFiles.RemoveBoundaries enabled, otherwise the raw boundary body is left in the POST stream and this event does not fire.

Example


procedure OnHTTPUploadReadInputEvent(Sender: TObject; const aName: string;
  const aValue: string);
begin
  DoLog('Input value received: ' + aName + ':' + aValue);
end;

Back to Events