Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/01/2013, 15:15
Avatar de rgf1987
rgf1987
 
Fecha de Ingreso: diciembre-2012
Ubicación: Asturias
Mensajes: 269
Antigüedad: 12 años, 1 mes
Puntos: 22
Respuesta: Guardar imagen con JAVA

Continuando con este tema

Cita:
Iniciado por chuidiang Ver Mensaje
Imagino que lo que quieres hacer es subir un fichero al servidor, aquí tienes como [url]http://chuwiki.chuidiang.org/index.php?title=File_upload_con_JSP[/url]

Se bueno.
Despues de impletar dicho codigo me surge el siguiente error si ponlo como ruta de destino

Código JAVA:
Ver original
  1. File fichero = new File("\\images", uploaded.getName());

me sale el siguiente error

Código ERROR:
Ver original
  1. HTTP Status 500 -
  2.  
  3. type Exception report
  4.  
  5. message
  6.  
  7. descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
  8.  
  9. exception
  10.  
  11. java.io.FileNotFoundException: \images\foto.jpg (El sistema no puede encontrar la ruta especificada)
  12.  
  13. note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.
  14. GlassFish Server Open Source Edition 3.1.2.2

por otro lado si intento poner una ruta absoluta

Código JAVA:
Ver original
  1. File fichero = new File("C:\\PROYECTO\\AplicacionWeb\\web\\images", uploaded.getName());

me da el siguiente error:

Código ERROR:
Ver original
  1. HTTP Status 500 -
  2.  
  3. type Exception report
  4.  
  5. message
  6.  
  7. descriptionThe server encountered an internal error () that prevented it from fulfilling this request.
  8.  
  9. exception
  10.  
  11. java.io.FileNotFoundException: C:\PROYECTO\AplicacionWeb\web\images (Acceso denegado)
  12.  
  13. note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2.2 logs.

Alguna idea de porque pasa esto? He supuesto que era por el tema de permisos, los he cambiado pero sigue sin funcionarme :(