Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing a file to a servlet for processing

 
Mark Wa
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
 
Prashant Langade
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!