Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » File upload to server
File upload to server [message #897906] Wed, 25 July 2012 12:09 Go to next message
Stefan Mutschler is currently offline Stefan MutschlerFriend
Messages: 17
Registered: June 2012
Location: Baden-Baden, Germany
Junior Member
Hi!

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.

Thanks

Stefan
Re: File upload to server [message #898380 is a reply to message #897906] Thu, 26 July 2012 09:58 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 310
Registered: August 2011
Senior Member
Hi,

if you want to test if the putRemoteFile() works for you, you could create your own fileservice, copy the code into it and test it.
Don't forget to register your service

regards Bertin
Re: File upload to server [message #899292 is a reply to message #898380] Tue, 31 July 2012 11:27 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 128
Registered: March 2010
Senior Member
Hi there

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.

Regards
Claudio
Re: File upload to server [message #899338 is a reply to message #899292] Tue, 31 July 2012 13:50 Go to previous message
Stefan Mutschler is currently offline Stefan MutschlerFriend
Messages: 17
Registered: June 2012
Location: Baden-Baden, Germany
Junior Member
Ah, I see... makes sense. I'll create a custom service.

Thank you both...
Previous Topic:Wrong behavior of SmartField Ubuntu 12.04 /SWT
Next Topic:Multi-Module Applications
Goto Forum:
  


Current Time: Mon Dec 22 10:08:30 GMT 2014

Powered by FUDForum. Page generated in 0.08804 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software