Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Upload PDF using by webutil

user11334489Oct 24 2016 — edited Oct 25 2016

Hi All,

Unable to upload pdf file from client machine to Database

I'm using Oracle forms 10g and Oracle Database 10g and please find the below code and screenshot

Please give a solution for this

Thanks in advance.

CREATE TABLE lobs_table

(

blob\_id NUMBER PRIMARY KEY,

image\_blob BLOB DEFAULT empty\_blob(),

pdf\_blob BLOB DEFAULT empty\_blob()

);

1.Upload PDF :-

declare

vfilename varchar2(3000);

vboolean boolean;

begin

vfilename := client\_get\_file\_name('c:\\',file\_filter => 'Document files (\*.pdf)|\*.pdf|');

vboolean := webutil\_file\_transfer.Client\_To\_DB\_With\_Progress

                 (   vfilename,

                     'lobs\_table',

                     'PDF\_BLOB',

                     'blob\_id = '||:blob\_id,

                     'Progress',

                     'Uploading File '||vfilename,

                     true,  ---Asynchronous uploading

                     'CHECK\_LOB\_PROGRESS'); ---User Call back trigger

end;

2.Upload Image :-

declare

vfilename varchar2(3000);

begin

vfilename := client_get_file_name('c:\', file_filter => ' Image files (*.jpg)|*.jpg|');

client_image.read_image_file(vfilename,'jpg','lobs_table.image_blob');

client_image.write_image_file(vfilename,'jpg','lobs_table.image_blob',maximize_compression,ORIGINAL_DEPTH);

end;

3.Save :-

BEGIN

COMMIT;

EXCEPTION

WHEN OTHERS THEN

Message('Exception is '||SQLERRM);

END;

----------------

Trigger - CHECK_LOB_PROGRESS:

if webutil_file_transfer.Asynchronous_Upload_Success then

 message('File uploaded successfully');

 message('File uploaded successfully');

else

 message('Some error in uploading...');

 message('Some error in uploading...');

end if;

Upload_d.png

Thanks and regards,

Abu

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2016
Added on Oct 24 2016
10 comments
3,019 views