Reputation: 1141
I was wondering if anyone could tell me how to code a servlet which can receive a zip file in http request?
I googled but didn't find anything. If a zip file can't be sent using http request then please suggest an alternative
I'm not asking for examples on how to upload a file using a servlet. I need to know if a file can be sent to a servlet and if yes, then how?
For instance, if a string is sent to a servlet and you use the following code to get it: String value = req.getParameter(name);
but what if a file is sent? Can this be done?
Thanks in advance
Upvotes: 0
Views: 2103
Reputation: 900
Any file can be uploaded, there's no distinction if it is a zip or text file.
Just google "servlet file upload" for many results. One example is this: How to upload files to server using JSP/Servlet?
Upvotes: 2