Thanks, Paul,
I just face another problem, when I upload a file in the gateway file system the next time I want to upload and overwrite the file I get this error which file is open and used by java.exe.
> java.io.FileNotFoundException: java.io.FileNotFoundException: webserver\webapps\main\User Image\nader.png (The requested operation cannot be performed on a file with a user-mapped section open)
I simply want to save user profile pictures and user can change their user profile picture.
basePath = 'webserver/webapps/main/User Image/'
extension = event.file.name.split(".")[-1]
username = self.session.props.auth.user.userName
event.file.copyTo(basePath + username + "." + extension)