TsgcWebSocketServer_HTTPAPIGebeurtenissen › OnHTTPUploadAfterSaveFile

OnHTTPUploadAfterSaveFile Gebeurtenis

Wordt geactiveerd nadat een bestand dat is uitgepakt uit een multipart/form-data-upload op schijf is opgeslagen.

Syntaxis

__property TsgcWSHTTPUploadAfterSaveFileEvent OnHTTPUploadAfterSaveFile;
// typedef void __fastcall (__closure *TsgcWSHTTPUploadAfterSaveFileEvent)(TObject * Sender, const UnicodeString aFileName, const UnicodeString aFilePath);

Standaardwaarde

Opmerkingen

OnHTTPUploadAfterSaveFile is raised zodra een 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 het bestand (scan for viruses, wachtrij a background task, update a database...). De gebeurtenis runs in the context of the IOCP worker thread after alle files in het verzoek have been extracted.

Voorbeeld


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

Terug naar Events