Internal Event :: fileUpload
Availability:
SmartFoxServer PRO 1.5.0
Event name:
fileUpload
Description:
The event is fired by the server each time a client uploads a file using the clientside APIs
The uploaded file is stored by default in the webserver/webapps/default/uploads/ folder with an automatically generated name to avoid name collisions.
The original file name is however preserved and passed as a parameter in the event handler.
Properties:
| name | description | type | |
| files | A list of files that were uploaded. Each item in the array is an object with the following properties: - fileName: the name used by the server to store the file. - originalName: the original name of the file sent by the client |
Array | |
| user | The user object representing the client that uploaded the file | User |
Example:
function handleInternalEvent(evt)
{
if (evt.name == "fileUpload")
{
var files = evt.files
var user = evt.user
// Display the user name
trace("Files uploaded by: " + user.getName())
// Show uploaded files
for (var i in files)
{
trace("File: " + files[i].fileName + ", " + files[i].originalName)
}
}
}
See also: