Upload an image [message #679825] |
Thu, 02 April 2020 14:06 |
buggleboy007
Messages: 282 Registered: November 2010 Location: Canada
|
Senior Member |
|
|
Hello all,
I am trying to select an image when I press 'UPLOAD' button and unable to accomplish it. Hope one of you can assist me in this:
I have created a button called 'upload' and in 'when-button-pressed' trigger, I have the following code:
declare
v_file varchar2(4000) :=client_get_file_name ('','', 'C:\*.jpg', 'Select STYLE OF THE image', open_file, TRUE);
it_image_id ITEM:=FIND_ITEM('IMAGES.IMAGE_FILE_SOURCE_LOCALDATA');
begin
read_image_file(v_file,'ANY','IMAGES.IMAGE_FILE_SOURCE_LOCALDATA');
write_image_file(v_file,'ANY' 'IMAGES.IMAGE_FILE_SOURCE_LOCALDATA',maximize_compression,ORIGINAL_DEPTH);
end;
When I press the UPLOAD button, all it does is, it shows 'My Documents' folder and nothing beyond it happens.
My aim is to show the user 'C' drive and then allow him to select an image file. How can I accompolish this? I have an Image item already present on the form.
|
|
|
Re: Upload an image [message #679826 is a reply to message #679825] |
Thu, 02 April 2020 15:31 |
buggleboy007
Messages: 282 Registered: November 2010 Location: Canada
|
Senior Member |
|
|
I have tried the following too but no luck so far:
Declare
filename VARCHAR2(256);
begin
filename := GET_FILE_NAME( 'C:\|*.jpg|*.gif|');
READ_IMAGE_FILE(filename, 'ANY', 'IMAGES.IMAGE_FILE_SOURCE_LOCALDATA');
end;
|
|
|
Re: Upload an image [message #679827 is a reply to message #679826] |
Thu, 02 April 2020 15:50 |
buggleboy007
Messages: 282 Registered: November 2010 Location: Canada
|
Senior Member |
|
|
I solved it myself using the following code:
DECLARE
v_file varchar2(4000):=client_get_file_name ('','', 'C:\|*.TIFF|*.gif|', 'Select STYLE OF THE image', open_file, TRUE);
it_image_id ITEM:=FIND_ITEM('IMAGES.IMAGE_FILE_SOURCE_LOCALDATA');
BEGIN
CLIENT_IMAGE.READ_IMAGE_FILE(v_file,'', it_image_id);
END;
The problem was that the image that I was selecting was in the form of a JPEG format and Forms does not support that besides the image format property was set to 'TIFF'. Correcting this and cropping a .TIFF image format, I was able to upload the image on the form. This fixed my issue for now.
|
|
|
|
|
Re: Upload an image [message #684655 is a reply to message #684652] |
Sat, 17 July 2021 12:24 |
buggleboy007
Messages: 282 Registered: November 2010 Location: Canada
|
Senior Member |
|
|
MS DEVELOPER wrote on Sat, 17 July 2021 03:20yup it's help full for image load but i want to load pdf also save , but its processing for a while bit second but showing nothing in image fieled.please support
Glad that my code helped but no idea what the issue or root cause at your end is.
|
|
|