This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing a file to a servlet for processing  RSS feed

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to pass a PDF file to a servlet which I will create. The PDFs are storeed in a database, so I cant just read from disk. I will need to pass it as an attribute or something. What is the best way of doing this?

Am I right in thinking I cant keep it in a file object becuase a File object is just a pointer to a file on a disk?

help much appreciated
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you exactly need? Can you elaborate more?
 
Mark Wa
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found out now, I can read in the file using a ByteArrayInputStream
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats great!!!
Share your solution if you can,so that if anyone experiences the same issue,then it can be useful.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!