Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Store word documents as blobs using base 64 encoding

 
maruthan nagalingam
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
It would be helpful if you could help me with this issue.

I need to write sql scripts using base64 encoding to store a word document as blobs in the oracle database. i need to store the word documents as a one shot update using only scripts.. i havent worked on stored procedures as such.. and it would be nice if anyone can give me pointers as to how to start this approach..

thanks
Suman
 
Fatih Keles
Ranch Hand
Posts: 182
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi maruthan,

Why do you use Base64 encoding since you are already storing file in a BLOB? It will increase the size of data and will bring extra cost of encode/decode operations. If you are not in a special need for Base64 encoded data just store the data as BLOB. You can follow this guide from Oracle site.
 
maruthan nagalingam
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.. But my requirement is jus to create procedures or scripts that will insert all the word documents(.docx) as blobs into the database at one shot initially. I am aware that it could be done in the java side.. but my aim is to create scripts to store the .docx file as blobs..After storing it as blobs i need to read the blob ,convert the blobs into docx4j supporting format to open the word document in the web browser. Thats the reason i need to go for base64 encoding. Can you please provide me some approach regarding this.

thanks
 
Fatih Keles
Ranch Hand
Posts: 182
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that you are doing this in Oracle environment, here stackoverflow guys explain how to load a file into a blob with pl/sql. You may find many other sample code, just google it.

For base64 conversion oracle database has a built-in utl_encode package. I hope this will give you a head start.

Regards,
Fatih.
 
maruthan nagalingam
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Fatih,

Thank you so much for the initial approch to start with.. will go through the pointers and keep you informed..

thanks once again..

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic