Ver Mensaje Individual
  #9 (permalink)  
Antiguo 01/02/2012, 12:14
herwex
 
Fecha de Ingreso: agosto-2011
Ubicación: d.f
Mensajes: 283
Antigüedad: 12 años, 8 meses
Puntos: 4
Respuesta: subir archivo a servidor usando Struts2

Hola ElAthlit he seguido lo que me has comentado te pongo codigo:

Código PHP:

public String execute() throws Exception{
         
 try {            
            
String filePath ServletActionContext.getRequest().getSession().getServletContext().getRealPath("/");   ----->pregunto a ServletContext cual es el path

              
             
 
String concatenar "yeah/"+fileUploadFileName;
 
String FinalArchivo=filePath.concat(concatenar);  ---->agrego a que carpeta lo quiero agregar que en este caso es "yeah" y el nombre del archivo
             
 File fileToCreate 
= new File(FinalArchivo);  ----->creo el nuevo archivo
 FileUtils
.copyFile(this.fileUploadfileToCreate); -----> Copio el archivo temporarl al xls. (NECESITO SUBIR ARCHIVOS EXCEL)         
         } 
         catch (
Exception e) {            
             
e.printStackTrace();            
             
addActionError(e.getMessage());             
                   }       
         return 
SUCCESS

PERO NO ME APARECE EN LA CARPETA DEL PROYECTOOOOOO YA NO SE QUE HACER!!!!