This is what I have so far. I know the file works because when I force the .jpg extension and upload a .jpg image it works fine. But the filename looks like this with the appended .jpg.
E:\Documents and Settings\mgrif002\Desktop\data\upload_59fef24e_1302d1a3fb9__7ff5_00000001.tmp.jpg
try
{
String filePath = "E:/Documents and Settings/mgrif002/Desktop/data/";
//System.out.println("Server path:" + filePath);
System.out.println(form.getFile().getAbsolutePath());
File fileToCreate = new File(filePath,form.getFile().getAbsolutePath()+".jpg");
FileUtils.copyFile(form.getFile(), fileToCreate);
Dicom dicom_file = new Dicom(pid,fileToCreate.getAbsolutePath(), form.getName(),true,((short)1));
ccr.saveDicom(dicom_file);
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
Just replace
.tmpby.jpginstead of appending.jpg. There are several ways, such as substringing the part until the last period, or regex replacing the last.tmppart, etc.