Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 2.0 FileDialog configuration problems(Configuration of the RAP 2.0 FileDialog (max file size and different FileUploadReceivers))
RAP 2.0 FileDialog configuration problems [message #1053484] Mon, 06 May 2013 08:39 Go to next message
René Brandstetter is currently offline René BrandstetterFriend
Messages: 17
Registered: July 2012
Junior Member
Hi,

I hope somebody could help me with my problems concerning the configuration of RAP 2.0 FileDialog to upload some files. Currently I have three problems and I don't know how to solve them.



  1. configure the max file size to be uploaded
    I know that the FileUploadHandler has the possibility to configure the maxFileSize but the instance of the FileUploadHanlder is created directly in the constructor of the UploadPanel and I can't see any possibility to configure it. So those anybody know if there is way to do this?
  2. display an error message if an error happened during the file upload
    I know that errors like "file larger than max file size" and "IO errors" are handled and propagated via a FileUploadListener registered on the FileUploadHandler, but I can't find a way to register my own listener and the one registered within the UploadPanel is only installed if you configure the FileDialog to upload multiple files at once. So if you configure the FileDialog to only upload one file you wouldn't see the error at all and otherwise you only recognize that there is an error if you display the tooltip of the progressbar. So is there a way to change this behavior?
  3. specify a different FileUploadReceiver
    As far as I know it should be possible to change the FileUploadReceiver for doing some additional checks or change the way files are stored, but I can't find any ExtensionPoint or other configuration mechanism to specify this. I had again a look at the UploadPanel and there the DiskFileUploadReceiver was created in the constructor and couldn't be changed afterwards. So is there any way to change this which I haven't seen or should the FileUploadReceiver never be changed?


Regards
René
Re: RAP 2.0 FileDialog configuration problems [message #1057983 is a reply to message #1053484] Fri, 10 May 2013 10:27 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1291
Registered: July 2009
Senior Member

IIRC, the underlying apache.fileupload library hardly supports limiting
the uploaded filesize. What it does is to throw an exception AFTER the
file has been completely uploaded. I'm not sure if there's a newer
fileupload version available in Orbit that improves things.

As for the FileDialog, since this is SWT API it should remain unchanged.
Thus a limitation would have to be configured elsewhere. I could imagine
an attribute in the ApplicationContext that is respected by the
fileupload component.

In any case, a solution would mean a change in the fileupload incubator
component which is currently maintained by Austin Riddle. If you like
to contribute a patch, please let us know.

Best regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.0 FileDialog configuration problems [message #1058585 is a reply to message #1057983] Tue, 14 May 2013 13:58 Go to previous message
René Brandstetter is currently offline René BrandstetterFriend
Messages: 17
Registered: July 2012
Junior Member
Hi Ralf,

thanks for the answer I will try to find the time to build a patch.

BTW, the size of the file which will be uploaded is known before the entire content was sent to the server, because it's specified in the "Content-Length" header of the multipart mimetype. This header attribute is even checked and prevents the file upload but there is no way to configure it at the moment.

Regards,
René
Previous Topic:How to let the user move something over the screen?
Next Topic:RAP export as WAR using Tooling
Goto Forum:
  


Current Time: Thu Nov 27 07:07:03 GMT 2014

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

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