• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

file upload not working in Trinidad tag

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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];
// 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);

}catch(Exception e){}

return null;

now the problem is

is not printed and also file name and file size not printed
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!