Link to home
Create AccountLog in
Avatar of Hermann Hirschauer
Hermann HirschauerFlag for Germany

asked on

Forms 12c: get_file_name function, to get a file open dialog for files located on the server, does not work.

I need a file open dialog in the Forms application, for the user to browse a directory located on the server.
i.e. the user presses a button, gets a file open dialog to browse a directory, and selects a file, which gives me the name of the file, so that I then can show it programatically with web.show_document.

I tried get_file_name  function (not client_get_file_name, because the files are on the server), but just nothing happens: neither a file open dialog box, nor any error message.
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

"... to browse a directory located on the server", which server?  This would have to be on the application server, not the database server (if those servers are separate).  I haven't used Forms12, but this was true in all earlier versions of Oracle Forms that are web-based.  If you want to browse directories on the database server, you will have to use a Java function in the database (that you could call from Oracle Forms).
Avatar of Hermann Hirschauer


Yes, I want to browse files located on the application server.
Is this maybe a permissions issue on the application server?  Does the O/S user that runs Oracle Forms have permission to browse the server directory that you want to browse?
Yes, just checked again: the user who runs Oracle Forms, is also the owner of the directory, and of the files in it.
Additionally, even if there would be missing permissions, the file open dialog box should at löeast open, and then show no results, or give an error message.
But the statement just seems to do nothing, no visible results, no error message.
Maybe someone else will be able to help you.  I have a lot of Oracle Forms experience, but only in earlier versions and never with the "get_file_name" function.

One other option that helped sometimes in earlier versions of Oracle Forms was to add a "message..." command in the program unit or trigger just before and after the call you are having trouble with.  I don't understand why that helped, but sometimes that caused Oracle Forms to work better.
I tried
 this with nessage before and after, but did not help.
I did not use it in 12c. But in the documents ( I find:
*Although modules that use the GET_FILE_NAME Built-in will successfully compile/generate, calls to this built-in will do nothing (NULL is returned).
That is consistent with the behavior you mention. I don't know a oracle forms replacement for that functionality.

If you only want to select a file from a known directory on the oracle server,  you could try  a workaround  by issuing a HOST command (if permitted)  that  spools  the directory listing to a file, and read that listing-file (TEXT_IO) into an lov on your form and select from there.  
I did not use that method on the form server myself, but something like that to select a file on the database server  (using a redwood batch-job for the command and utl_file to read the file)
If the HOST command is still supported in Forms12 (it was supported in all earlier versions of Forms) that suggestion from flow01 should give you a way to do this in Forms12.
This is not a acceptable way. I think, if there is no other option to do that, then I will have to tell the customer, that this is not possible.
I would use that host and text_io combination to populate a record group on Oracle Forms if this was my system.  The user (or customer) doesn’t know if the record group was populated by a single function call or by a multi-step procedure.  As long as it works and is quite fast, that is usually fine.
The host and text_io combination does not come into consideration, because it creates severall follow-up problems.
The functionality just is not more available in Web versions of Oracle Forms, as also confirmed by Oracle Support (File open dialog is only availabe on clientside with webutil).
This is, what I will also tell the customer, and thereby finish the issue.
Avatar of Hermann Hirschauer
Hermann Hirschauer
Flag of Germany image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account