When defining the upload file path in java, we try to use "/" to divide the path instead of "\\". Because when we deploy to Linux system, "\\" will be parsed as "/" string as the file name. So after uploading and then downloading, the path will not be found.
Such as:
String ctxPath = request.getSession().getServletContext().getRealPath("/") + "upload/" + userName + "/";