I am trying to send a csv,png,gzip etc. files into my server . In order to process these files it needs to be filtered based on the proper extension ( csv,png,gzip).
If I can get the filename then I can parse it to get the extension. This is the way i am sending file:
curl -u user:password -H "Transfer-Encoding: chunked" -T file_name_location -v --noproxy server_name -X POST http://server_name:8080/
I am new to java servlet. I tried printing the httprequest but unable to do so.
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response;
System.out.println("The http request is " + httpRequest );
I cannot send any header except "Tranfer-encoding" in curl command. That is the limitation. Thanks