Stefan Mutschler Messages: 21 Registered: June 2012 Location: Baden-Baden, Germany
How can I upload a file from the client to the server? RemoteFileService contains a method putRemoteFile() which sounds like a possible candidate but it is disabled for remote access (annotated with @RemoteServiceAccessDenied). I'd like to store client contracts in a server directory.
The annotation is present due to security reasons. Calling this method is possible but only from the server. So you have to create a custom service which delegates the file upload to the RemoteFileService.
This gives you the possibility to allow or deny a file upload.
Btw: If you would like to store your files in a database you do not necessarly have to use the remote file service. Instead, you could create a byte and send it to the server. Have a look at the IOUtility for helper methods.