TsgcWebSocketHTTPServerEvents › OnHTTPUploadAfterSaveFile

OnHTTPUploadAfterSaveFile Event

Fires after a file extracted from a multipart/form-data upload has been saved to disk.

Syntax

public event TsgcWSHTTPUploadAfterSaveFileEventHandler OnHTTPUploadAfterSaveFile;
// delegate void TsgcWSHTTPUploadAfterSaveFileEventHandler(TObject Sender, string aFileName, string aFilePath)

Default Value

Remarks

OnHTTPUploadAfterSaveFile is raised once a file from a multipart/form-data body has been written to disk (requires HTTPUploadFiles.StreamType = pstFileStream and HTTPUploadFiles.RemoveBoundaries = True). aFileName contains the final file name and aFilePath the directory where it was stored; combine them to process the file (scan for viruses, queue a background task, update a database...). The event runs in the context of the connection thread after all files in the request have been extracted.

Example


private void OnHTTPUploadAfterSaveFileEvent(TObject Sender, string aFileName, string aFilePath)
{
  DoLog("File Received: " + aFileName);
}

Back to Events