javascriptgoogle-app-enginegwtuploadgwtupload

GWTUpload add extra information


I'm using the GWTUpload lib for uploading, which works nicely. On the server side I override the executeAction() method of the UploadAction class.

But now I would somehow like to send some more information to the server e.g. to map the uploaded stuff to some user.

I'm not using sessions to identify anybody. I would only want to pass a simple extra id from the client to the server while uploading.

Can I modifiy the request parameters on the client side?


Solution

  • There is a few options, everything is described on GWTUpload wiki:

    http://code.google.com/p/gwtupload/wiki/Servlets

    Check "Sending additional parameters to the servlet" section.

    For example:

    Client side

      MultiUploader u = new MultiUploader();
      u.setServletPath(u.getServletPath() + "?myinfo=whatever");
    

    Server side

      String myInfo = request.getParameter("myinfo");