Parameter | Description |
---|---|
sFileName | Is the filename (without path) of the file being uploaded |
iBytes | Is the size in bytes of the file being uploaded |
sMime | MIME type of the file being uploaded |
This function must return the full path and filename where the uploaded file is to be saved.
Function OnFileUpload String sFileName BigInt iBytes String sMime Returns String
This event is fired before a new file upload starts. Its task is to determine the local path where the file should be stored. This needs to be an absolute path. The file path should include the file name.
Details of the uploaded file are sent as parameters. Note that the file size and Multipurpose Internet Mail Extensions (MIME) type can be empty on older browsers that do not provide this information.
OnFileUpload is called for each file in case of a multi file upload.
An empty string can be returned to cancel the file upload. In case of a multi file upload, the specific file will be cancelled but others will continue.
Function OnFileUpload String sFileName Integer iBytes String sMime Returns String String sPath // Determine local path based on workspace setting Get psDataPath of (phoWorkspace(ghoApplication)) to sPath Move (sPath + "\Uploads\" + sFileName) to sPath Function_Return sPath End_Function
For security reasons, the upload folder needs to be registered as an accessible upload folder for every process using RegisterUploadFolder.
This event does nothing in the cWebDragDropFileHelper class.
See Also