Debraj Dutta

Greenhorn
+ Follow
since Apr 16, 2012
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Debraj Dutta

<tr:inputFile value="#{backing_vomspostsalescollection.file}"
/>
</trh:cellFormat></trh:rowLayout>
<trh:cellFormat>
<tr:spacer width="10"/>
</trh:cellFormat>


<trh:rowLayout>
<trh:cellFormat width="8%">
</trh:cellFormat>
<trh:cellFormat >
<h:commandButton id="submit" image="images-red/bt-submit.gif" action="#{backing_vomspostsalescollection.saveData}" >
</h:commandButton>
</trh:cellFormat>
</trh:rowLayout>

after click on submit button saveData method is called


public String saveData() {
// Add event code here...


UploadedFile photo = getFile();
UploadedFile[] photo_ob = { photo };


try{


System.out.println(photo.getInputStream());

// File inputFile = multi.getFile(name);
// File file = ((MultipartRequest) context.getExternalContext().getRequest()).getFile(clientId);
UploadBlob ub = new UploadBlob();
// byte[] bytes = ub.getByteArray(photo);
// is = this.slipFile.getInputStream();
// byte inDataBytes[] = new byte[(int)bytes.length];
// is.read(inDataBytes);
// update = pdao.updatePANDetails(userid, pannumber, "uploaded", "", inDataBytes);


String insertdata = "";
Map responseMap=null;
DataBaseUtility dbutil = new DataBaseUtility("CSC");
Backing_vomspostsalescollection vomssessiondata =(Backing_vomspostsalescollection)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("backing_vomspostsalescollection");
// insertdata = dbutil.insertVomsData(vomssessiondata,inDataBytes);
is.close();

}catch(Exception e){}



return null;
}


now the problem is

System.out.println(photo.getInputStream());
is not printed and also file name and file size not printed