Sapan Sapan - 1 year ago 113
Java Question

Re usable, thread safe cmponents in commons-fileupload

I am using commons-fileupload to read image file from the POST request using classes DiskFileItemFactory and ServletFileUpload.

Can someone help me with which objects off the above can be re-used and accessed concurrently among threads or will have to be created anew for each request

Thanks in advance

Answer Source

Could not get any straight point in this direction. But found the Streaming API of the commons file upload here. Since it creates one ServletFileUpload object, So I think this migh be a better idea.

// Create a new file upload handler ServletFileUpload upload = new ServletFileUpload();

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download