This is a follow-up to what I was trying to accomplish here https://stackoverflow.com/questions/7313922/uploading-files-ussing-myfaces-tomahawk-jsf-2-0
I've managed to get the image as an UploadedFile
Object, but I can't seem to be able to save it to disk. I want to save it locally (in C:\Temp
, for example) such that when I run my app, I can upload a file (test.jpg
, for example) from my desktop and see it saved on the server (for example, in C:\Temp
).
My bean is pretty simple:
import org.apache.myfaces.custom.fileupload.UploadedFile;
public class PatientBB {
private UploadedFile uploadedFile;
public UploadedFile getUploadedFile(){
return this.uploadedFile;
}
.
public void setUploadedFile(UploadedFile uploadedFile){
this.uploadedFile = uploadedFile;
}
.
public String actionSubmitImage(){
//This is th part I need help with. how do I save it in my C?
}
I greatly Appreciate all the help, thank you!