Open bat file on client machine using webutil

Hi all.
I'm on devsuite 10g.
I want to run a bat file on client machine using client_host function of webutil.
I have tried first to execute the bat file with mouse double-click in order to check if it is ok, and it works.
Now I want to execute this file from my form using webutil.
Here is my code:
--> with this code I select a file from client machine
Declare
     LC$Fichier Varchar2(1000):=null ;
     PC$Filtre Varchar2(2000) := '|All files|*.*|' ;
Begin
     LC$Fichier := WEBUTIL_FILE.FILE_OPEN_DIALOG
     null,
     PC$Filtre,
     'Seleziona un file da caricare'
If LC$Fichier is not null Then
:output.apri_file := LC$Fichier ;
End if ;
End ;
--> with this code I execute the file that I have opened
declare
     cmd varchar2(30000) := null;
BEGIN
     Cmd := 'cmd /c start "" "' || :output.apri_file || '"' ;
CLIENT_HOST(cmd);
END;
When I execute my form I have this error:
Exception in thread "main" java.lang.NoClassDefFoundError: ....folder of file opened.
Can anyone help me to solve this problem??
Thanks in advance,
Fabrizio

Fabrizio Delli Priscoli wrote:
Hi Tony.
I have tried to run my bat file with double-click and everything is OK.
When you say the DOS window opens for few second, is your batch file being executed?? did you see the results??
The answer in NO for both of your questions.
If I try to drag and drop the file I have error.
How can I attach an image to this post, so that you can see the error??
Thanks,
FabrizioThis seems like a directory or OS level permission issue on the batch file, What is the error you got when you tried drag and drop the batch file in an DOS window???
I think you need to upload the image to a site and use the markup for the image, include the full URL of the uploaded file between ! (exclamation marks) something like ! http://../post.gif ! without the spaces.
Tony
Edited by: Tony Garabedian on Sep 4, 2008 12:30 PM

Similar Messages

  • Not able to create a text file in Client Machine using Forms 10g

    Hi - I'm mot able to create a text file in Client Machine using Forms 10g. I'm getting error when system executes the bolded line.(i.e. CLIENT_TEXT_IO.FOPEN). During run-time system is throwing "ORA-06508: PL/SQL: could not find program unit being called".
    I had attached webutil.pll in the form.
    Please advise me.
    DECLARE
    l_Temp CLIENT_TEXT_IO.FILE_TYPE;
    LC$Name Varchar2(100) ;
    LC$Fic Varchar2(100) ;
    LN$Lines Pls_integer := 0 ;
    LC$Line Varchar2(4000) ;
    Cursor C_CUR Is
    Select * From TEST_TEXTIO where rownum <= 50;
    BEGIN
    LC$Name := 'tmp_file.txt' ;
    LC$Fic := 'c:\temp\tmp_file.txt';
    Begin
    l_temp := CLIENT_TEXT_IO.FOPEN( 'C:\temp\tmp_file.txt', 'W');
    Exception
         when others then
         message( 'OPEN FILE ERROR ' || LC$Fic ||sqlerrm );
         display_error;
         raise form_trigger_failure;
    End ;
    -- Write the lines --
    For Cur In C_CUR Loop
         LC$Line := Cur.CODE || ' -> ' || Cur.COL1 || ',' || Cur.COL2 || ',' || Cur.Col3 ;
         CLIENT_TEXT_IO.PUT_LINE( LF$File, LC$Line ) ;      
         LN$Lines := C_CUR%ROWCOUNT ;
    End loop ;
    -- Close the file --
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
    Exception
         When others Then
    message('err='||sqlerrm);message(' ');
    display_error;
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;      
         Raise ;
    END;
    Thanks.
    Arun

    Hi ,
    i have one Question though its not related to thos question if some could help me it will be really helpful,
    i have created one program to import and export excel to forms vice versa, if the form is attached with webutil its working fine am using ole2.but i have a new idea if i add this program in menu, it can be used for all the forms attched to that menu, i made program also, but problem am facing right now is if the form is not attched with webutil it will not work so is there possiblity to share my webutil from one form to another form ,so i will keep one form as a interface form in that webutil will be attched ,i can share that webutil to all other forms so that all the forms no need to attach webutil again
    if its possible means please suggest some ideas

  • How to write files on Client Machine using JSP

    Hi,
    I am new to JSP. Please tell me how do i write files on Client machine thru a Browser.
    Please let me know at the Earliest.
    Thanks.
    Mehul Dave

    1) Well I find it rather convenient to deploy a web app as just one file rather than a bunch of files. For deployment it's much better. However I prefer using expanded files when developping (to use auto reload in Tomcat for example)
    2) It is a bad idea to upload files inside your webapp's context (ie: in it's deployment directory) because one day an uninformed system administrator might come and redeploy the web app and therefore delete all your uploaded files (believe me, I've already experienced this!)
    What i do usually is upload it in a completely different directory, something like /uploaded_files. Your uploaded files are therefore completely independant from your webapp
    However it is a bit trickyer to get those files back. Let's take the example of image uploads. You have 2 ways of proceeding:
    - the easiest : configure your web server (apache etc...) to redirect a certain url to your external directory. For example the /upload url will point to a /uploaded_files directory. This is easier to do and the fastest way to serve images but not always the best solution: you are dependant on the web server's configuration and you can't control the visibility on your files (no security constraints, anyone can see your uploaded files if they know the url).
    - you can also write a servlet which will load the file as an array of bytes and send it back in the response.
    You can call it this way :
    <img src="/serlvets/showmyimage?path=uploaded.gif">
    in this way you can control your uploaded files better: you may want to define security constraints on the visibity or not of uploaded files depending on the user which has logged on the site.

  • Opening  a file from client machine

    Hi All ,
    I have a requirement .I need to <b>integrate / Open </b> an .exe file in the portal and this exe file will reside on every on every client machine from which portal is accessed . Can you suggest me some methods . I have tried with URL iview , but it is not working .
    Thanks
    Aneez
    <b>P.S Guaranteed points for helpful answers</b>

    Hi Aneez,
    In the registry the URL(s) that you add are for the source, not target. So you will have something like;
    URL1=http://<portal>:<port>
    of course this would allow any code run from your portal to open exe files without a warning; so you can add the URLs of individual iViews to your registry if you want a bit more control from a security point of view.
    Where you launch the apps;
    javascript:launchApp('c:\windows\notepad.exe c:\autoexec.bat')"
    I think you can only launch one app at a time, here you pass one string containing the paths to two apps, pass one at a time to the launchApp function.
    Also, try adding four '\' characters each time instead of two, one an escape character for the Java compiler and one an escape character for the JavaScript in the browser.
    Temporarily add
    alert(strCmdLine);
    to your launchApp function to see the exact path that the function is trying to launch, make sure that this path contains one and only one '\' character at each point, eg "C:\Windows\notepad.exe". You can also put the
    obj.LaunchApplication(.....
    line in a try/catch block, put an alert in the catch and see if there's a problem with the JavaScript code trying to launch the app or if the problem is elsewhere.
    As far as using XP goes...... I've used LaunchInIE at a few customer sites but I don't think that any were using XP so I can't say that I've seen this working under XP. Perhaps on the WhirlyWiryWeb website you can find some info about whether or not you can expect this to work under XP.
    Perhaps, if there's another PC in or near your office that has access to your portal but doesn't have XP installed you can try it from there yourself and see if your code is working on that machine but not yours with XP installed.
    I hope this helps,
    Patrick.
    Edit.
    Of course if you're running this from some HTML file on your own harddisk and not from the portal for testing purposes then in your registry the URL that you need to add should be localhost, 127.0.0.1.
    Message was edited by: Patrick O'Neill

  • Creating excel file on client machine using oracle pl/sql code

    Hi All,
    I have a situation where in i need to create an excel output file in my client machine, but using UTL_FILE i understood that i need to create the directory on server and i need to read and write on server itself.
    Is there any other way where we can create a excel file other than oracle server, bcos this is used only once and there is no scheduler to execute on server.
    Please do the needful.
    Thanks,
    Santhosh.S

    santhosh.shivaram wrote:
    I have a situation where in i need to create an excel output file in my client machine, but using UTL_FILE i understood that i need to create the directory on server and i need to read and write on server itself.I would say that you only need to to look at basic client-server architecture - what is the client component responsible for and what is the server component responsible for.
    The server should create the data set required by the client - do all the (intense) server processing that servers do well. This data set is then send to the client. The client is responsible for rendering that data set.. or saving it to the client machine storage if needed.
    Within PL/SQL that is quite easy to do using the most common/standard client-server in use today - web based client-server.
    The client is a web browser. It makes a call to the web server, that is serviced by a PL/SQL database procedure - a so-called web enabled procedure. It processes the request from the web browser, and returns a dynamic response. This response can range from HTML and XML, to video and image streams - and also CSV (Character Separated Values) data.
    By default, most web browsers will use the local client spreadsheet application (like MS Excel) to open the CSV response received. Many web browsers will also provide an alternate option of saving that response as a CSV file (that can then be opened later using MS Excel).
    Straight forward and basic client-server - and easily done using PL/SQL. Even easier done using (freeware) Oracle APEX (Application Express). APEX is a PL/SQL software suite that provides a web development system (only web browser required for development) and a run-time system to run the web application you have created.

  • Setting Default Printer on Client Machine using Webutil

    hi.........
    i have configuired webutil on Application Server.
    i want to develop a form using webutil from which user can set default printer from client's machine.....
    i have tried using CLIENT_WIN_API_ENVIRONMENT.READ_REGISTRY();......BUT NOT YET SOLVED..
    Is there any other solution except using CLIENT_WIN_API_ENVIRONMENT.READ_REGISTRY();
    pls help me asap........

    Swapnil,
    There are a lot of posts about this. I suggest you search the Forms Forum for 'WebUtil default printer' and see if you can find some that has solved this issue.
    Sorry, I could be more helpful. I started looking through these posts myself and finally decided I was the wrong person doing the search! :-)
    Craig...

  • How to download a file from server machine to client machine using jsp

    Hi,
    In my application, I have an excel file stored on my server machine. How can I download that excel file on to my client machine using jsp. Is there any other way I can open that file from my machine and save it in my machine using jsp/java?
    Its an emergency for me to do this.
    Can anyone provide me the full code to download a file from server machine as I don't have
    time to browse through various sites.
    thanks in advance,
    Tiijnar

    Please post your code using code tags (click on CODE above the text area, when posting)
    response.setContentType("application/octet-stream");Why octet-stream? Set the correct mime-type.
    String disHeader = "Attachment; Filename=\"filename\"";The filename should just be the file's name. Not the complete path to the file! This will tell anyone where the file is located on the server. It's also inconvenient because by default,the browser will suggest it as the name for the download.
    Your way of writing to the output stream is just plain wrong. See this snippet (picked from [http://balusc.blogspot.com/2007/07/fileservlet.html])
            BufferedInputStream input = null;
            BufferedOutputStream output = null;
            try {
                // Open streams.
                input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
                output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
                // Write file contents to response.
                byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
                int length;
                while ((length = input.read(buffer)) > 0) {
                    output.write(buffer, 0, length);
                // Finalize task.
                output.flush();
            } finally {
                // Gently close streams.
                close(output);
                close(input);
            }

  • File Transfer From Unix server to Windows Client System Using WebUtil

    Hi all,
    I want to Transfer a File from Unix Server to Window Client System using Webutil. But below mention code is not working.
    DECLARE
         V_Server_Path VARCHAR2(500) := Null;
         V_Client_Path VARCHAR2(500) := Null;
    BEGIN
         V_Server_Path := '/proj/oraapps/viper/dev/reports/cache/Saveauftr.txt';
         V_Client_Path := 'C:\Migration\EU_Applications\Lima\OAS_WorkArea\Client\Saveauftr.txt';
         IF WebUtil_File_Transfer.Is_AS_Readable(V_Server_Path) THEN
         IF WebUtil_File_Transfer.AS_To_Client(V_Client_Path,V_Server_Path) THEN
              Message('Downloading the File ..... .... ... .. .');
              Message('Downloading Was Successfull ...');
              Message('File Transfer from Server Was Successfull ...');
         END IF;
    END IF;
    END;
    Can anyone suggest me,Why the above code is not working and what to do for solve the Problem.
    Regards
    Gany

    Hello,
    You have more chances to get an answer in the Oracle Forms OTN Forum :
    Forms
    Regards

  • How to delete file from client machine

    Hi all,
    we are using the DataBase: oracle:10g,
    and forms/reports 10g(developer suite 10g-10.1.2.2).
    can anybody help me how to delete the file from client machine in specified location using webutil or any
    (i tried with webutil_host & client_host but it is working for application server only)
    thank you.

    hi
    check this not tested.
    PROCEDURE OPEN_FILE (V_ID_DOC IN VARCHAR2)
    IS
    -- Open a stored document --
    LC$Cmd Varchar2(1280) ;
    LC$Nom Varchar2(1000) ;
    LC$Fic Varchar2(1280);
    LC$Path Varchar2(1280);
    LC$Sep Varchar2(1) ;
    LN$But Pls_Integer ;
    LB$Ok Boolean ;
    -- Current Process ID --
    ret WEBUTIL_HOST.PROCESS_ID ;
    V_FICHERO VARCHAR2(500);
    COMILLA VARCHAR2(4) := '''';
    BOTON NUMBER;
    MODO VARCHAR2(50);
    URL VARCHAR2(500);
    Begin
    V_FICHERO := V_ID_DOC;
    LC$Sep := '\';--WEBUTIL_FILE.Get_File_Separator ; -- 10g
    LC$Nom := V_FICHERO;--Substr( V_FICHERO, instr( V_FICHERO, LC$Sep, -1 ) + 1, 100 ) ;
    --LC$Path := CLIENT_WIN_API_ENVIRONMENT.Get_Temp_Directory ;
    LC$Path := 'C:';
    LC$Fic := LC$Path || LC$Sep || LC$Nom ;
    If Not webutil_file_transfer.DB_To_Client
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    Raise Form_trigger_Failure ;
    End if ;
    LC$Cmd := 'cmd /c start "" /MAX /WAIT "' || LC$Fic || '"' ;
    Ret := WEBUTIL_HOST.blocking( LC$Cmd ) ;
    LN$But := WEBUTIL_HOST.Get_return_Code( Ret ) ;
    If LN$But 0 Then
    Set_Alert_Property( 'ALER_STOP_1', TITLE, 'Host() command' ) ;
    Set_Alert_Property( 'ALER_STOP_1', ALERT_MESSAGE_TEXT, 'Host() command error : ' || To_Char( LN$But ) ) ;
    LN$But := Show_Alert( 'ALER_STOP_1' ) ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Raise Form_Trigger_Failure ;
    End if ;
    If Not webutil_file_transfer.Client_To_DB
    LC$Fic,
    'TABLE_NAME',
    'ITEM_NAME',
    'WHERE'
    ) Then
    NULL;
    Else
    Commit ;
    End if ;
    LB$Ok := WEBUTIL_FILE.DELETE_FILE( LC$Fic ) ;
    Exception
    When Form_Trigger_Failure Then
    Raise ;
    End ;sarah

  • Creation of CSV file on client machine with data from forms

    Hi,
    My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form.
    Oracle version -
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production.
    I have searched the web for last couple of days and got to know that TEXT_IO is to be used to generate files on client machine. However, when I tried TEXT_IO, it was not able to generate the file on client rather it was able to generate on database server. After further browsing on this, there was a link which said that we need to use CLIENT_TEXT_IO to generate file on client side. For this, i was required to subclass the webutil.pll which i did and corrected the code to use CLIENT_TEXT_IO. The form was unable to compile and was not able to find "webutil_core" package.
    I am very confused with the disparity in the information available on the web as in what to use to generate a file on client side. If anyone has use it in the past, can he/she please detail what to use to get things sorted.
    Thanks,
    R

    Oracle version - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production. >
    So, what is your FORMS version. This is more important than your database version.
    My requirement is to generate a CSV file(or .XLS) on the client machine ie local drive with the details shown in a form. Depending on your Forms version, you would use TEXT_IO (if Forms 6i running in Client/Server mode) or WebUtil (if Forms 9i or higher).
    I'm going to guess that you are at least using Oracle Forms 9i since you stated that your attempt at using TEXT_IO produced a file on the DB server.
    There is more to using WebUtil than just attaching the WEBUTIL.PLL. If you had performed a simple search of the Forms Help System would have found numerous WebUtil topics to include: Introduction to WebUtil, Configuring WebUtil, Using WebUtil in Your Applications and the WebUtil User's Guide. If you have Oracle Forms release 10g or higher, WebUtil is included when you installed Forms, however, you do need to configure your installation to use WebUtil and you must download the Java COM Bridge (jacob.jar) from Source Forge. Take a look at the Configuring WebUtil Forms Help topic to find out which version of the Java COM Bridge you will need to download.
    After you have successfully configured WebUtil, take a look at the Using WebUtil in Your Applications topic to find out how to implement WebUtil in a form.
    Searching the Internet for answers is great, but don't forget the look at the Forms Help System because the majority of your questions can be answered there. :)
    Lastly, configuration of WebUtil is primarily done on your Application Server (AS). However, if you plan to perform preliminary runtime testing by running your Form from the Forms Builder, then you will configure your local runtime to support WebUtil as well as configure your AS. The steps are exactly the same. A common mis-step is to skip a step during the configuration because you don't think the step applies. Take a look at the Forms Help Runtime Setup Checklist topic for a list of step you need to complete in order to enable WebUtil.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Copy file from client machine to unix db server

    Dear all,
    I have oracle form 10g, and data base server using 10 r 2,
    I have an oracle for to browse client XML file and return the name of the file including the path to TEXT item what I want to do after that is to copy the seelcted file from the client to DB server (hint this server over Unix operating system)
    I tried
    V_Cpy_Result := Webutil_File.Copy_File ('C:\File_Name.Xml', '/u01/oradata/odsuat/ssr_xml_dir/Outbound/File_Name.Xml');
    but this does't work, please provide me with the way or the command that I can copy the selected file from client to Unix DB server...

    Hello,
    If you want to transfer files between client machine and A.S. or database machine, use the Webutil file_transfer package's functions.
    Francois

  • How to find out a file from client machine

    hi all,
    I want to read a file from client machine, like a outlook express file in which all the address are saved, using servlet. Initially i do not know the file path for that file, How i can read that file.
    plz help me
    thanx in advace
    Manish

    You have 2 possibilities. First, you might be able to mount the client's disk drive at the server; the servlet can then access that drive directly. Second, install a client program on the client machine and communicate with that program, and have it do the search (or whatever).
    Outside of Java, there are remote-access programs - like PCAnyWhere.

  • JSP to Upload file from client machine to Web Server!

    Hi,
    I want to upload a file from client machine to web server in order to send it as email attachment, How can I do it? After uploading the file the class should give me the path where the file is stored on the web server and the file name in return!
    I know the HTML <file> field but dont know how to copy it on web server, HTML Part will be:
    <FORM ENCTYPE="multipart/form-data"
    method="POST" action="My.jsp">
    <INPUT TYPE="file" NAME="mptest">
    <INPUT TYPE="submit" VALUE="upload">
    </FORM>
    Please help!
    Thanks,
    - Rahul

    You can use cos.jar provided by O'Reilly from http://www.servlets.com/cos/. Take a look at com.oreilly.servlet.multipart.* classes.
    Package is provided with source, classes, documentation and, of course, ready-to-use jar file.
    It is really usefull and - ready!

  • How to upload file from client machine to  database in server machine?

    I am developing a web application. this application is suppose to take file from client machine and store that to database in the server side.
    My jsp form is of multi part type. but I am confused about what to write in servlet.
    Can any one help me ?
    Edited by: chinmaya_mishra on Feb 16, 2009 2:55 AM
    Edited by: chinmaya_mishra on Feb 16, 2009 2:58 AM

    http://www.google.com/search?q=jdbc+blob
    Blob processing varies between databases; see also examples for whatever database you are using, e.g.
    http://www.google.com/search?q=jdbc+blob+oracle
    If you are storing text data instead of binary data, replace "blob" by "clob" in the searches.

  • Save file on client machine on the web.....

    Hi,
    I have a Form Application C/S 6i where I create a file using Get_File_Name, TEXT_IO.fopen .... etc. This application it's OK. The problem is when I load the application on AIS9i. The application don't load never. I must create and save a file on client machine when I use application on the web. What Can I do? Is This operation possible without radical change of the code source?
    Thanks

    Erik,
    actually this project is under the leadership of the same author that created d2kwutil. It is too early to tell what exactly will be in this package and most likely we will release things step by step as they finish. However, you canuse this thread for a wishlist of functionality and I will pass it to the project lead. The implementation will be both POL/SQL and Java (as Java is the only way for us to access the client side in teh Web). The project target is sometime mid of next year. As said, the project hasn't really started yet so it is too early to speculate on what will make it in and when this will be delivered.
    Frank

Maybe you are looking for