How to open a file using OAF

Hi,
I want to open a file using OAF. I know the path and file name.
How can I open it, if file is in UNIX or in windows, where ever.
Is there any way to do that.
Thanks in Advance!!

Hi Ankur,
I had something link this requirement, that also for a concurrent program output only, but the output was txt file, and make it a zip file and give a dynamic link and open it.
For that i used the following code, may be it will help.
String zipout = pageContext.getParameter("ZIPOUT");
if(zipout!=null && zipout.equals("Y"))
try
DataObject sessionDictionary = (DataObject) pageContext.getNamedDataObject("_SessionParameters");
HttpServletResponse response = (HttpServletResponse) sessionDictionary.selectValue(null, "HttpServletResponse");
HttpServletRequest request = (HttpServletRequest) sessionDictionary.selectValue(null, "HttpServletRequest");
String requestID = pageContext.getParameter("REQUESTID");
response.setHeader("Content-Disposition","p; filename=CatExtract"+requestID+".zip");
response.setContentType("application/x-zip-compressed");
ZipOutputStream zip = new ZipOutputStream(response.getOutputStream());
try
byte[] buffer = new byte[1024];
int bytesRead;
//to get the value of output directory
String fileName = "/o"+requestID+".out";
Serializable[] parameters = { requestID };
//Get the output URL for this requests output.
pageContext.getApplicationModule(webBean).invokeMethod("getOutputURL", parameters);
String outputURL = (String)pageContext.getTransactionValue("OutputURL");
pageContext.writeDiagnostics(this.getClass().getName(),"outputURL in the xxt CO"+outputURL,1);
try
URL fileURL = new URL(outputURL);
URLConnection urlConn = fileURL.openConnection();
DataInputStream out = new DataInputStream(urlConn.getInputStream());
try
ZipEntry entry = new ZipEntry(fileName);
zip.putNextEntry(entry);
while ((bytesRead = out.read(buffer)) != -1)
zip.write(buffer, 0, bytesRead);
zip.closeEntry();
pageContext.writeDiagnostics(entry.getName(), " added.",1);
catch (Exception ex)
pageContext.writeDiagnostics(this.getClass().getName(),"Exception 113"+ex,1);
finally
out.close();
catch (IOException ex)
pageContext.writeDiagnostics(this.getClass().getName(),"Exception 124"+ex,1);
System.out.println("Exception 124 "+ex);
Thanks.
With Regards,
Kali.

Similar Messages

  • How to open/read file using Java in Unix?

    Hi Friends,
    Can you please help me out how to open/read file using java in unix os? I have create one text file in "/home/test.txt" in unix environment. How to open the same file & read using java code?
    - Hiren Modi

    http://java.sun.com/docs/books/tutorial/essential/io/index.html

  • How to open RAW files using elements 10 with a pc using windows xp and nikon D3300

    i have an old pc running on windows xp to which i downloaded elements 10. i recently bought a nikon d3300 and am shooting RAW. is there a way to open the RAW files using elements 10?

    The 8.4 dng converter won't work on windows xp, but will on windows 7.
    The newest version of the dng converter that works on windows xp is 8.3
    http://blogs.adobe.com/lightroomjournal/2013/12/camera-raw-8-support-on-windows-xp-windows -vista-and-mac-osx-10-6.html
    Since you have windows 7 you might as well use the newest version of the dng converter 8.7.1
    (covers the same cameras as 8.3, with some added and bug fixes)
    Adobe - Adobe Camera Raw and DNG Converter : For Windows : Adobe DNG Converter 8.7.1

  • How to open saved files using 'read from text file' function

    Hi everyone, I am having a hard time trying to solve the this particular problem ( probably because I am a newb to lanbview ). Anyway , I am able to save the acquired waveforms by using the 'Write to text file' icon. I did manually modify the block diagram of the 'Write to text file' icon and create the correct number of connector so as to make my program work. But now I have no idea on how to modify the block diagram of the 'Read from text file' block diagram to make my program 'open' my saved waveforms. Or i do not have to modify anything from the block diagram of the 'Read from text file'? Can anyone teach/help me connect up? Do i need the build array on the "open" page?
    Here are some screenshots on part of my program  
    let me know if you guys would need more information / screenshots thank you!
    Attachments:
    ss_save.jpg ‏94 KB
    ss_open.jpg ‏94 KB
    modified_writetotextfile.jpg ‏99 KB

    Ohmy, thanks altenbach. oh yeah i forgot about those sub VIs. will upload them now. Was rather demoralized after reading the comments and really struck me on how weak i'm at on labview really hope to get this done. But of course i have to study through and see how it works. Actually i am going to replace those 'signal generators sub vi' with ThoughtTechonology's sample code so i can obtain data waveforms real-time using Electrocardiography (ECG) ,Electromyography (EMG ) and Electroencephalography (EEG) hopefully i can find out how to connect the sample code.
    ( ps . cant connect it now unless my program is working otherwise labview will crash ) 
    ( p.s.s the encoder of my biofeedback trainer already acts as an DAQ so i wont need to place an DAQ assistant in my block diagram i suppose )
    The sample code of ThoughtTechnology is named as attachment.ashx.vi. too bad i cant use it and present it as my project
    Attachments:
    frequency detactor.vi ‏53 KB
    signal generator.vi ‏13 KB
    attachment.ashx.vi ‏40 KB

  • How to open pdf file using flash

    i have problem with this file pdf file opens in flash it was working but  pdf file was open in same browser can i open it sapropte browser window i am learner in coding so please guide me.
    using this code.
    on(release){
        getURL("file://e:/SBI updated/New Kcc Sheme 2012/common/pdf/KCC New Documents ANNX.pdf");

    I have no idea what "sapropte" means, nor does Google translate.  If by chance you mean you want to open a new browser window then specify the window argument (look up the getURL function for other options)
    getURL("file://e:/SBI updated/New Kcc Sheme 2012/common/pdf/KCC New Documents ANNX.pdf", "_blank");
    If the problem is that the file does not open when you test on a server it might be because you are targeting a folder on the computer instead of on the server.

  • HT4796 I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    I have made a file using the Pages app.I mailed it to a friend.When she tried opening the same file on her pc at home , It did not open.Please help me as to how to open the file in the Microsoft word format on her pc.

    Send it as a PDF.

  • How to open pdf files in browser using flex

    hi,
    my project is having a Document explorer wchich contains pdf
    files,iwant to open it in the browser.can any one tell me how to
    open pdf documents using flex programming(i tried with different
    thing like swf's but my client wants only pdf formatt).

    Another option is by calling a JSP page. This example will
    open a pdf file into a new browser without displaying the download
    "save" prompt.
    Function to call the JSP:
    private function downloadFlyer(event:Event):void {
    var jspLink:URLRequest = new
    URLRequest("jsp/downloadpdf.jsp?fileName=Fundraiser_flyer_2008.pdf");
    navigateToURL( jspLink, "_blank" );
    JSP code:
    <%@ page errorPage="error.jsp" %>
    <%@ page import="java.io.*" %>
    <%
    //Get the parameters
    String downloadFileName=request.getParameter("fileName");
    String fileName = application.getRealPath("/downloads/" +
    downloadFileName);
    File file = new File(fileName);
    if (!file.exists()) {
    throw new IOException("File does not exist.");
    // Get the size of the file
    long length = file.length();
    // You cannot create an array using a long type.
    // It needs to be an int type.
    // Before converting to an int type, check
    // to ensure that file is not larger than Integer.MAX_VALUE.
    if (length > Integer.MAX_VALUE) {
    throw new IOException("File too big.");
    response.reset();
    response.resetBuffer();
    response.setContentType( "application/pdf" );
    response.setHeader ("Content-Disposition", "filename=" +
    downloadFileName);
    //Prevent the Java error: "getOutputStream() has already
    been called for this response"
    out.clear();
    out = pageContext.pushBody();
    InputStream in = new FileInputStream(file);
    OutputStream output = response.getOutputStream();
    try {
    int curByte=-1;
    while( (curByte=in.read()) !=-1){
    output.write(curByte);
    } catch (IOException ioe) {
    ioe.printStackTrace(System.out);
    } finally{
    output.flush();
    in.close();
    response.flushBuffer();
    %>

  • How do I force safari to open pdf files using Adobe???

    How do I force safari to open pdf files using Adobe and not in the browser?

    You need Acrobat Reader as a Safari plug in.
    http://get.adobe.com/reader/

  • How to open PSD file recieved via email on iPad using Photoshop Touch without Creative Cloud?

    Hi, how to open PSD file recieved via email on iPad using Photoshop Touch without the need of using Creative Cloud? Thanks.

    Hi Super Nemo
    Currently the only way to open psd files on Photoshop touch is via the creative cloud. Also, the layers you created from Photoshop on your desktop machine will be flattened when opened with Photoshop touch on your iPad. But you can retain the layers from the touch app when opening the psdx file on your desktop photoshop.
    This link might help you: http://forums.adobe.com/docs/DOC-1336
    -Sharon

  • How to open a file created at the server through form/report at client end

    How to open a file created at the server through form/report at client end
    Dear Sir/Madame,
    I am creating a exception report at the server-end using utl file utility. I want to display this report at the client end. A user doesn't have any access to server. Will u please write me the solution and oblige me.
    Thanks
    Rajesh Jain

    One way of doing this is to write a PL/SQL procedure that uses UTL_FILE to read the file and DBMS_OUTPUT to display the contents to the users.
    Cheers, APC

  • How to open *.pdf files in BOXI r2 inbox

    I am scheduling as  *.pdf file for deski report.After scheduling i am getting *.pdf in my inbox.if the report is deski or webi we can use FC_REPORT_ENGINE or WI_REPORT_ENGINE to open the report's using java code.In same way how to open *.PDF file in Inbox?
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM

    Hi Ram,
    Following information might help you to resolve the issue.
    After logging into Desktop Intelligence, you may be presented with a message stating:
    u201CYou have received 1 document from users"
    Examining the Inbox from within the Desktop Intelligence client shows no objects visible in your Inbox.
    The object in your Inbox is in a format other than Desktop Intelligence format such as, PDF, XLS or other format. Therefore the object is not recognized by the Desktop Intelligence client inbox browser.
    Log in to Info View or the Central Management Console, browse to your Inbox and verify the file name and format that has been sent to your Inbox. The object may be saved, copied, moved or deleted as necessary.
    Regards,
    Sarbhjeet Kaur

  • How to open NRW-files in Lightroom 4?I

    just bought Nikon's Coolpix P7800. It says you can shoot in Raw. Now I want to open these files in LR, just like I'm used to with my SLR's. But Nikon uses the NRW-format for Raw and LR says it doesn't recognise the files. Does someone know if there's a way to convert and work with these files in LR 4?

    Thanks Jim for your response,
    I will upgrade to 5.3
    Kind regardsEut van Berkum
         Op woensdag 28 januari 17:04 2015 schreef JimHess <[email protected]> het volgende:
    how to open NRW-files in Lightroom 4?I
    created by JimHess in Photoshop Lightroom - View the full discussionThe only way to use those files with Lightroom 4 is to convert them to DNG using DNG converter 8.3 or higher. The camera wasn't supported in Lightroom until version 5.3. If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7140310#7140310 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7140310#7140310 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Photoshop Lightroom by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • Open pdf file using ms access visual basic 2000 (9.0.2720)

    I'm using Acrobat reader to open pdf file using a vb proceedure , how ever I can't get it to open a specific file thats in another file folder.
    The code I'm using looks like the following: This is windows 7, using the (x86) virtual in 32 bit mode.
    Private Sub Form_Click()
    'checks for valid msds document
    Dim fs As FileSearch
    Dim stAppName As String
    Dim i As Integer
    On Error GoTo Err_form_Click
    Set fs = Application.FileSearch
    With fs
                 .NewSearch
                .LookIn = "c:\program files (x86)\cvmm\msds\"
                .FileName = Me![MSDS Index #] & ".pdf"
                .MatchTextExactly = True
    If .Execute() <> 0 Then
                        stAppName = "C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe c:\program files(x86)\cvmm\msds\" & Me![MSDS Index #] & ".pdf"
                          Call Shell(stAppName, 1)
               End If
                     End With
    exit sub
    Err_form_Click:
        MsgBox Err.Description
             Resume Exit_form_Click
    Exit_form_Click:
            MsgBox " no file found."
    End Sub
    This used to work when I was using acrobat 5.0,

    You should have quotes around a filename that has spaces in it. Older versions were more forgiving for some reason.
    Much better anyway is to use ShellExecute, which means you don't have to know or care what PDF reading software is installed and how to run it.

  • HOW TO OPEN WINDAT FILES

    How to open windat files which come along with E mails from microsoft users ?

    That is priceless, "you can ignore winmail.dat...."  No I can't. They are often a drawing or purchase order I require for a job.
    I am running outlook on my mac and I still can't open them. All my other devices open these attachments no problem (none of them are apple). The people sending me these attachments are using macs. The only thing that has changed since I started encountering this problem is my hardware. I still use outlook, I have the same email address. The PDF attachments are being sent by the same people in the same way. When I had an iphone they opened on there too. Why do all the people on this forum keep blaming microsoft. Why can't macs read microsoft RTF, much like gmail or yahoo manage to do.
    I cannot go asking busy project managers to send me attachments in a different format simply because I bought what I thought to be a decent computer.

  • How to open XML file in Netscape

    How to open XML file in Netscape.....
    XML file is opening correctly in IE, but giving error in Netscape.Error is
    Error loading stylesheet: Parsing and XSLT stylesheet failed....
    Reply me soon..............

    You may check these tips:
    How to Access Local File Systems from J2ME devices using FileConnection API
    http://www.java-tips.org/content/view/109/73/
    Opening and reading a file on the mobile device
    http://www.java-tips.org/content/view/352/73/

Maybe you are looking for