Home » Developer & Programmer » Forms » retrieving images from file system (Forms 10g , vista sp1)
retrieving images from file system [message #475574] Wed, 15 September 2010 16:14 Go to next message
aj_aaron2002
Messages: 15
Registered: August 2010
Location: London
Junior Member
Hello friends,
I am trying to retrieve images from the file system, but the open dialog box is not popping up for me to choose which file i want. It does nothing gives no error. Just says record 1/1 on the message bar at runtime.

I have two blocks on the module. One is the lobs_table block and the other is the control block. On the control block i have a when-button-pressed trigger on an item. And here is the code below.



Declare
jpg_image_dir VARCHAR2(100) := 'C:\Users\ajayia\Desktop\Me_pics';
photo_filename VARCHAR2(100);
BEGIN
:System.Message_Level := '25';
photo_filename := jpg_image_dir||:LOBS_TABLE.CHAR_CLOB||'.jpg';
READ_IMAGE_FILE(photo_filename, 'JPEG', 'LOBS_TABLE.IMAGE_BLOB');
WRITE_IMAGE_FILE(photo_filename,'JPEG','LOBS_TABLE.IMAGE_BLOB',MAXIMIZE_COMPRESSION,ORIGINAL_DEPTH);

IF NOT FORM_SUCCESS THEN
MESSAGE('SQLERRM: ' || SQLERRM);
--MESSAGE('This employee does not have a photo on file.');
END IF;
:SYSTEM.MESSAGE_LEVEL := '0';
end;


Please help me. I don't know the code to use to get forms to bring up the open dialog box.

Thanks in anticipation.

Cheers
Aj
Re: retrieving images from file system [message #478203 is a reply to message #475574] Thu, 07 October 2010 01:26 Go to previous message
lancer26
Messages: 52
Registered: May 2006
Location: Pakistan
Member

use get_file_name for opening dialog box.


Displays the standard open file dialog box where the user can select an existing file or specify a new file.

Syntax

FUNCTION GET_FILE_NAME
(directory_name VARCHAR2,
file_name VARCHAR2,
file_filter VARCHAR2,
message VARCHAR2,
dialog_type NUMBER,
select_file BOOLEAN;


Built-in Type unrestricted function
Returns VARCHAR2
Enter Query Mode yes

Parameters

directory_name
Specifies the name of the directory containing the file you want to open. The default value is NULL. If directory_name is NULL, subsequent invocations of the dialog may open the last directory visited.


file_name
Specifies the name of the file you want to open. The default value is NULL.


file_filter
Specifies that only particular files be shown. The default value is NULL. File filters take on different forms, and currently are ignored on the motif and character mode platforms. On Windows, they take the form of "Write Files (*.WRI)|*.WRI|" defaulting to "All Files (*.*)|*.*|" if NULL. On the Macintosh the attribute currently accepts a string such as "Text."

message
Specifies the type of file that is being selected. The
default value is NULL.

dialog_type
Specifies the intended dialog to OPEN_FILE or sAVE_FILE. The default value is OPEN_FILE.


select_file
Specifies whether the user is selecting files or directories. The default value is TRUE. If dialog_type is set to SAVE_FILE, select_file is internally set to TRUE.


Previous Topic: Is Form 6i support CLOB???
Next Topic: pl/sql tables
Goto Forum:
  


Current Time: Thu Sep 19 17:14:05 CDT 2024