TsgcWebSocketServer_HTTPAPI › Events › OnHTTPUploadAfterSaveFile
Fires after a file extracted from a multipart/form-data upload has been saved to disk.
public event TsgcWSHTTPUploadAfterSaveFileEventHandler OnHTTPUploadAfterSaveFile;
// delegate void TsgcWSHTTPUploadAfterSaveFileEventHandler(TObject Sender, string aFileName, string aFilePath)
—
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 IOCP worker thread after all files in the request have been extracted.
private void OnHTTPUploadAfterSaveFileEvent(TObject Sender, string aFileName, string aFilePath)
{
DoLog("File Received: " + aFileName);
}