Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:35:59+00:00 2026-06-15T12:35:59+00:00

I am trying to read a PDF into a blob object then do an

  • 0

I am trying to read a PDF into a blob object then do an INSERT into my oracle database so that it can be sent off as an attachment. Now the email portion is working, and it adds an attachment but the attachment is always corrupt and I can’t open it. Below is the code where I create my blob pdf, can someone help me figure out why this isn’t creating the proper attachment?

ls_pdf_name = ls_pdf_path + "\" + "invnum_" + ls_invoice + ".pdf"  
ls_pdf_filename = "invoice_" + ls_invoice +  ".pdf"
ls_rc = wf_check_pdf_status(ll_invoice_number, ls_sub_type, ll_user_supp_id)
If ls_rc = "Y" Then
    li_fnum = FileOpen(ls_pdf_name, StreamMode!)
    li_bytes = FileRead(li_fnum, bPDF)
    FileClose(li_fnum)
    ll_rc = wf_update_pdf_tables(bPDF, ls_pdf_filename, ls_sub_type, ll_user_supp_id, ll_invoice_number, ls_month, ls_year)

EDIT

So I took Calvin’s advice and switched my insert to the following:

Here is the INSERT statement that puts the blob into the table

INSERT INTO ATTACH_DOCUMENT
(id, filename, mime_type, date_time_created)
VALUES
(ATTACH_DOCUMENT_SEQ.NEXTVAL, :pdf_filename, 'application/pdf', CURRENT_TIMESTAMP);

UPDATEblob ATTACH_DOCUMENT
SET data = :pdf
WHERE id = ATTACH_DOCUMENT_SEQ.CURRENTVAL;

But when I go to open the PDF email attachment from my email, Adobe opens up with this error – Could not open because it is either not a supported file type or because it has been damaged (for example it was sent as an email attachment and wasn’t decoded correctly)

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:36:00+00:00Added an answer on June 15, 2026 at 12:36 pm

    How big is the PDF file?

    You may not be getting all the contents with a simple FileRead() – try using FileReadEx()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to read a .doc file into a database so that I can
Trying to read into an object the following XML file (can be changed) into
I am trying to read multiple files (can be of any format i.e. pdf,
I am trying to read one PDF and copy its data into another PDF.
From PostgreSQL, am trying to read an image file into an Imagick object -
I am working on an application that can read pdf documents and I am
I have an id that i am trying to read from my database and
I'm trying to insert and read qrcode's from PDF files. To create/read qr codes
I am trying to read a pdf from a url without downloading and then
I am trying to read in a PDF template with iTextSharp, and then automate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.