This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes file upload not working in Trinidad tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "file upload not working in Trinidad tag" Watch "file upload not working in Trinidad tag" New topic

file upload not working in Trinidad tag

Debraj Dutta

Joined: Apr 16, 2012
Posts: 1
<tr:inputFile value="#{backing_vomspostsalescollection.file}"
<tr:spacer width="10"/>

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

after click on submit button saveData method is called

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

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



// 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];
// 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);

}catch(Exception e){}

return null;

now the problem is

is not printed and also file name and file size not printed
I agree. Here's the link:
subject: file upload not working in Trinidad tag
Similar Threads
how to acces backingBean from popup
Why File name is becoming null in action class ?
Retain File Selected in a File Upload Component
File upload
sending image to server using HTTP connection