Hi Experts,
I am using jdev 11.1.1.5.0.
for that i refer a link as https://www.youtube.com/watch?v=9vHUzHeq95k.
My Bean was
private BlobDomain createBlobDomain(UploadedFile file)
{
System.out.println("enter into a method");
InputStream inStream =null;
OutputStream outStream=null;
BlobDomain domain=null;
domain = new BlobDomain();
try {
inStream = file.getInputStream();
System.out.println("enter into a inStream");
outStream = domain.getBinaryOutputStream();
byte[] buffer = new byte[8192];
int byteRead=0;
while((byteRead = inStream.read(buffer,0,8192))!=-1) {
outStream.write(buffer,0,byteRead);
}
inStream.close();
}
catch(SQLException e) {
e.printStackTrace();
}
catch(IOException e) {
e.printStackTrace();
}
return domain;
}
private UploadedFile _File;
public String UploadProcess() {
UploadedFile file= this.getFile();
System.out.println("enter into a method");
BindingContext bindingctx=BindingContext.getCurrent();
BindingContainer bindingcnt =bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingImple =(DCBindingContainer)bindingcnt;
DCIteratorBinding dciter=bindingImple.findIteratorBinding("CrmMktgLeadsVO1Iterator");
ViewObject vo = dciter.getViewObject();
Row row = vo.getCurrentRow();
//Row row =iterator.getCurrentRow();
row.setAttribute("CmlImageId",createBlobDomain(file));
return null;
}
public void setFile(UploadedFile _File) {
this._File = _File;
}
public UploadedFile getFile() {
return _File;
}
public void setIf1(RichInputFile if1) {
this.if1 = if1;
}
public RichInputFile getIf1() {
return if1;
}
While Clicking a uploadImageProcess button it shows a Null pointer Exception.
How to Achieve this.
Thanks