Hello, > -----Ursprüngliche Nachricht----- > Von: Lauri <dbam...@hotmail.com> > Gesendet: Mittwoch, 31. Mai 2023 11:04 > An: Tomcat Users List <users@tomcat.apache.org> > Betreff: Re-Cannot upload an image file from a deployed JSP page in Tomcat > 10 > > Ho Thomas, > > I still do not understand everything. > > I understood the following: > > 1) > From Tomcat 10 and onwards there has been a move from Java EE to Jakarta > EE as part of the transfer of Java EE to the Eclipse Foundation, the primary > package for all implemented APIs has changed from javax.* to jakarta.*. > > 2) > I understood from your post that the package commons-fileupload has > dependencies to the old javax package. > > 3) > I can remove the commons-fileupload-* jar files from my application > (because of what has been said above): > /u01/tomcat/base/middleware/tomcat10/webapps/TESTS/WEB-INF/lib: > commons-fileupload-1.5-test-sources.jar > commons-fileupload-1.5-tests.jar > commons-fileupload-1.5-sources.jar > commons-fileupload-1.5-javadoc.jar > commons-fileupload-1.5.jar > > Can you tell me what I should modify on the JSP file that I have posted if I > want to upload a binary file (image,...) ? > What modules should I use if these are wrong ? > > <%@ page import="org.apache.commons.fileupload.*" %> => TO REMOVE > <%@ page import="org.apache.commons.fileupload.disk.*" %> => TO > REMOVE <%@ page import="org.apache.commons.fileupload.servlet.*" %> > => TO REMOVE <%@ page import="java.io.*" %> <%@ page > import="java.util.*" %> <%@ page import="jakarta.servlet.*" %> <%@ page > import="jakarta.servlet.http.*" %> <%@ page import="javax.servlet.http.*" > %> <%@ page import="jakarta.sql.*" %> <%@ page import="java.sql.*" %> > <%@ page > import="org.apache.commons.fileupload.disk.DiskFileItemFactory" %> => > TO REMOVE <%@ page > import="org.apache.commons.fileupload.FileItemFactory" %> => TO > REMOVE > > Kind Regards, > > Lauri
You can access the file-stream like: Part part = request.getPart("file"); InputStream stream = part.getInputStream(); Here are some examples: http://www.java2s.com/example/java-api/javax/servlet/http/httpservletrequest/getparts-0-0.html Greetings, Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org