Dear List,
I am trying to upload files with Turbine, so I have created an Action that
looks as follows:
//doPerform ...
ParameterParser params = data.getParameters();
FileItem fi = params.getFileItem("foto");
String realPath = data.getServletContext().getRealPath("/");
File file = new
File(realPath+TurbineResources.getString("services.UploadService.repository"
)
+File.separator+"fotos"+File.separator+"file.gif");
file.delete();
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
fos.write(fi.get());
fos.flush();
However, I get a NullPointerException because the sentence fi.get() returns
null. The fact is that when I try to get anything from the FileItem, this
object returns null.
Do you know how can I solve this?
Thanks,
Otto.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]