Send additional data to Java server-side using Dojo file upload client-side -


When uploading files with dojo,

I need to send additional data to server side. How do I do it?

I am using the Dojo file uploader's upload method.

My Javascript code:

  function (uploader), file list, dom, on, carousel, content pen, swap view) { Dojo.ready (function {var form = dojo.byId ("myForm"); var Uploader DDO = dojo.byId ("Uploader"); Up = New Uploader (Upload), Name: 'uploaded file [ ] ', Url:' / testserver / rest-services / submitForm ',}). Place (uploader);  

and my server side code:

  @ path ("/ submitForm") @ POST @Consumes ( "Multipart / form-data") @ products ({MediaType.TEXT_HTML, MediaType.APPLICATION_JSON}) Public Response Upload File (MultipartFormDataInput Input) {string filename = ""; Maps & lt; String, list & lt; InputPart & gt; & Gt; FormParts = input.getFormData map ();  

I recommend using Apache file upload here because it Too many In my implementation of simplifying my life, I have established a mapped servicelet for upload URL and handled the request in a doPost method:

< Pre> public class MySQL HTTPSvellate Extended {@ Override Secure Zero DoPost (HttpServletRequest Request, HttpServletResponse Reaction), IOException {// ...}}

Using piggybacking, you can add URL parameters directly on the information provided by the bishop in response to your question Did they And & amp; On the server side, you will need to read those URL parameters from the request: character (ie? One = one and two = two): string .get parameter ("one"); String two = request.getParameter ("two");


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -