PDA

View Full Version : File upload handling



Feltros
28 Nov 2008, 10:54 AM
I know this isn't strictly an EXT question, but i've searched high and low for any useable code examples showing how to handle file uploads on the server side - And I knew that this community would comprise of people who have come across this exact problem and found a solution so I thought i'd ask you.

I'm assuming you require to extend RemoteServiceServlet and put your file receiving code in the

protectedvoid doPost(HttpServletRequest request,
HttpServletResponse httpServletResponse)
overidden class from RemoteServiceServlet. However, being a protected method i'm told I can't override it - so this has just confused me even more since all the code examples I can find involve that method being overriden. Am I supposed to be extending HttpServlet or something else instead?

If anyone can point me in the direction of a full example in GWT of a basic file upload handler (Not using any peculiar libraries/additions such as Spring, although i'm open to commons-IO) I would be most greatful. In particular, what class do I extend in my fileUploadController server side class, what method do I use to retrieve the POST data, and relevant XML entries (although i'm assuming the only entry required will be
<servletpath="/fileUpload"class="com.blah.foo.FileUploadController"/>
)

Thanks kindly for your help

skanberg
1 Dec 2008, 12:14 AM
There are some server side examples here: http://extjs.com/forum/showthread.php?t=42859

/Fredrik