title: Cannot insert BLOB data into table
body: <p>I am trying to store an image in a blob column. I created the table,  job_resumes2, using the following code:</p>
  
  <pre><code>create table job_resumes2(
  resume_id number,
  first_name varchar2(25),
  last_name varchar2(25),
  profile_picture blob);
  </code></pre>
  
  <p>I then created a directory:</p>
  
  <pre><code>create directory myimages as 'C:\MYIMAGES';
  </code></pre>
  
  <p>I then executed the following procedure to populate the table, but I get an error when executing it:</p>
  
  <pre><code>SQL&gt; DECLARE
    2  SRC bfile := bfilename('MYIMAGES','x.jpg');
    3  dest blob;
    4  begin
    5  insert into job_resumes2 values(1,'John','M',empty_blob())
    6  returning profile_picture into dest;
    7  dbms_lob.open(src,dbms_lob.lob_readonly);
    8  dbms_lob.loadfromfile(dest,src,dbms_lob.getlength(src));
    9  dbms_lob.close(src);
   10  commit;
   11  end;
   12  /
  DECLARE
  *
  ERROR at line 1:
  ORA-22288: file or LOB operation FILEOPEN failed
  The data is invalid.
  ORA-06512: at "SYS.DBMS_LOB", line 1031
  ORA-06512: at line 7
  </code></pre>
  
  <p>I have ensured that the directory and the file, x.jpg, exist.
  What is the problem and what can I do to fix it?</p>