Archivos jsp
Babilon gracias de antemano por leer esto resulta que tengo un formulario html para cargar archivos en el servidor con jsp, este usa unas clases ya compiladas a la hora de correr esto en jsp solo me sale la parte de html <H1>jspSmartUpload : Sample 1</H1> que esta en el jsp pero se supone que tiene que cargar el archivo en la carpeta virtual que ya esta creada también no entindo porque no hace completo el jspp
Este es el código html
<HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <FORM METHOD="POST" ACTION="/jspsmartupload/sample1.jsp" ENCTYPE="multipart/form-data"> <INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR> <INPUT TYPE="SUBMIT" VALUE="Upload"> </FORM> </BODY> </HTML>
y el codig jsp es este
<%@ page language="java" import="com.jspsmart.upload.*"%> <jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /> <HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <% // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); mySmartUpload.setTotalMaxFileSize(100000); // Upload mySmartUpload.upload(); try { // Save the files with their original names in the virtual path "/upload" // if it doesn't exist try to save in the physical path "/upload" count = mySmartUpload.save("/upload"); // Save the files with their original names in the virtual path "/upload" // count = mySmartUpload.save("/upload", mySmartUpload.SAVE_VIRTUAL); // Display the number of files uploaded out.println(count + " file(s) uploaded."); } catch (Exception e) { out.println(e.toString()); } %> </BODY> </HTML>
Este es el código html
<HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <FORM METHOD="POST" ACTION="/jspsmartupload/sample1.jsp" ENCTYPE="multipart/form-data"> <INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR> <INPUT TYPE="SUBMIT" VALUE="Upload"> </FORM> </BODY> </HTML>
y el codig jsp es este
<%@ page language="java" import="com.jspsmart.upload.*"%> <jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /> <HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <% // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); mySmartUpload.setTotalMaxFileSize(100000); // Upload mySmartUpload.upload(); try { // Save the files with their original names in the virtual path "/upload" // if it doesn't exist try to save in the physical path "/upload" count = mySmartUpload.save("/upload"); // Save the files with their original names in the virtual path "/upload" // count = mySmartUpload.save("/upload", mySmartUpload.SAVE_VIRTUAL); // Display the number of files uploaded out.println(count + " file(s) uploaded."); } catch (Exception e) { out.println(e.toString()); } %> </BODY> </HTML>
2 Respuestas
Respuesta de babilon
1
Respuesta
1