FILE TO BLOB PLSQL

create table KR_FOTO_TEST(
        filename        varchar2(100) primary key,
        FOTO        blob
);

declare
        fHnd            bfile;
        b               blob;
        srcOffset       integer := 1;
        dstOffset       integer := 1;
begin
        dbms_lob.CreateTemporary( b, true );
        fHnd := BFilename( 'KR_FOTO_DIR', 'test.jpg' );
        dbms_lob.FileOpen( fHnd, DBMS_LOB.FILE_READONLY );
        dbms_lob.LoadFromFile( b, fHnd, DBMS_LOB.LOBMAXSIZE, dstOffset, srcOffset );

        insert into KR_FOTO_TEST values( 'test.jpg', b );
        commit;

        dbms_lob.FileClose( fHnd );
end;
/