TsgcWebSocketServer_HTTPAPIEvents › OnHTTPUploadReadInput

OnHTTPUploadReadInput Event

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

Syntax

public event TsgcWSHTTPUploadReadInputEventHandler OnHTTPUploadReadInput;
// delegate void TsgcWSHTTPUploadReadInputEventHandler(TObject Sender, string aName, string aValue)

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


private void OnHTTPUploadReadInputEvent(TObject Sender, string aName, string aValue)
{
  DoLog("Input value Received: " + aName + ":" + aValue);
}

Back to Events