Open a local file in webdynpro

Hi All,
I am trying to open a file residing on user's desktop in webdynpro.
1. I have written a html page with javascript to open the file
window.location = 'file:///C:/Documents and Settings/mkharoda/Desktop/Questions.txt';
This file opens up if I open it up in IE browser and opens the file specified in the path.
2. I added this html page in my mimes folder
3. Assigned this html page as a source to IFrame (Although its deprecated but I don't see any other option)
When I execute my WD Applicaiton, it shows a blank page in IFrame. The same html page works fine when opened directly in the IE.
Expecting quick help sdn.
Also, if you have an alternate solution to open a local file then please suggest me.
Regards,
Murtuza

Hi,
One thing you have to understand here is Webdynpro doesnot support java script.
So their is no way to do things at client side using the scripting.
What ever is possible is at the server side, when you say that the local file need to be read with out uploading to the server (FileuploadUI) looks a bit unrealistic with webdynpro.
I dont have idea about JSF integration to WD , if you can create Components that supports java script and then embed them using the JSF bridge might be of help in this scenario.
Other alternative could be a component in Flex (that too not sure)
Regards
Ayyapparaj

Similar Messages

  • How to open a local file from javascript in a jsp-page

    Hi
    I have created an iview from a PAR file. In the par file I have a jsp-page with some javascript code. From the javascript coe I want to open a new window with an Excel file.
    I have tried window.open("c:
    test.xls", "test_window"), but it doesn't seem to work. I have created a small HTML page locally with the same command and there a new window opens with the Excel file.
    If I change the local file path with an URL it also works.
    Any idea how to open a local file ?
    Thanks
    /Jakob

    Jacob,
    I'm not 100% (but 99,9%) and it has to do with security ristrictions of the browser not allowing to have local workstation interation from the web. This is ofcourse very dangerous if the browser would allow it... So therfore it is blocked. What if somone would point to a file/executable that formats your drive so for that reason it is not allowed to have web interaction with a local file. Only with Java Applets this is possible but still with many limitations, and what I remember Google Gears and Adobe Air do have some limited web 2 local file interaction... So best and most simple solution you are left with is pointing to a url instead of a file on a c:\ drive.
    PS The reason why it works when you start the html from your local PC has todo with the fact that the browser detects that the html is not running in the web at that moment therefor allowing the access.
    Cheers,
    Benjamin Houttuin

  • Firefox crashes when opening a local file (a .jpg photo) click drive, click directory and it crashes.

    Firefox crashes when clicking FILE / OPEN FILE / Drive (G:)/and when double clicking the directory containing the file. It happens every time I'm trying to open a local file. Must close, go to Internet Explorer, Opera or Chrome which have no problems doing this.

    You are running out of memory. In the stack notice this line:
    Caused by: java.lang.OutOfMemoryError: Java heap space
    Edit the sqldeveloper.conf file and add this
    AddVMOption -Xmx1024M
    That will bump it up some.
    -kris

  • Open a local file from a web Service

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

    Hello!
    Likely this is a trivial question, but I need to open a local file from a Web Service and i don't know how to get the file path. I mean that I have a WS source code placed in a proper package (my.ws.package) with an additional configuration XML file placed in the same directory. I need to read it, but if I use merely
    File conf = new File("Conf.xml");it can't find it. I've tryed with:
    MyWS.class.getClass().getProtectionDomain().getCodeSource().getLocation().getPath()in order to get the file path, but a
    java.security.AccessControlException access denied (java.lang.RuntimePermission getProtectionDomain)arises...
    I don't know...
    Suggestions?
    Thanks.
    Anhur

  • Why won't my I pad open a local file

    Why can't I open a local file with safari

    It was a web address that my employer gave me and when I put it in to the address bar and hit go it comes up with the error message cannot open a local file

  • Open a Local file from JSP

    Hi All,
    I want to access a local file from a JSP. On click of the link the local file should open. The location of the local file is
    O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    and the hyper link on the JSP shows
    file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc
    somehow the file does not open from the JSP page but it opens from the browser if I type
    'file:///O:/VWS00000000000000000001/REPORT_FRAGMENTS/Title1.doc' in the address bar.
    Can anybody please help.
    regards,
    Shardul.

    if you'd like to show the real path to the user, use simply an ftp server !
    however, if you prefer a secure solution, so use a servlet:
    example:
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.IOException;
    import javax.servlet.ServletException;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class SendWord extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        //get the 'file' parameter
        String fileName = (String) request.getParameter("file");
        if (fileName == null || fileName.equals(""))
          throw new ServletException(
              "Invalid or non-existent file parameter in SendWord servlet.");
        // add the .doc suffix if it doesn't already exist
        if (fileName.indexOf(".doc") == -1)
          fileName = fileName + ".doc";
        String wordDir = getServletContext().getInitParameter("word-dir");
        if (wordDir == null || wordDir.equals(""))
          throw new ServletException(
              "Invalid or non-existent wordDir context-param.");
        ServletOutputStream stream = null;
        BufferedInputStream buf = null;
        try {
          stream = response.getOutputStream();
          File doc = new File(wordDir + "/" + fileName);
          response.setContentType("application/msword");
          response.addHeader("Content-Disposition", "attachment; filename="
              + fileName);
          response.setContentLength((int) doc.length());
          FileInputStream input = new FileInputStream(doc);
          buf = new BufferedInputStream(input);
          int readBytes = 0;
          while ((readBytes = buf.read()) != -1)
            stream.write(readBytes);
        } catch (IOException ioe) {
          throw new ServletException(ioe.getMessage());
        } finally {
          if (stream != null)
            stream.close();
          if (buf != null)
            buf.close();
      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
        doGet(request, response);
    }hope that helps

  • How do I stop Dreamweaver from updating the Test server copy of a file when I open the local file?

    The subject says it all. Every time I open a file, Dreamweaver connects to the testing server and uploads the local file to the test server.
    I want to stop this behaviour.  It's annoying!

    My testing server is IIS running on my local machine.
    The "local" copy of the file is actually on a remote share.  I have the test server copy open in Notepad++.  The two files are identical save for on extra line in the copy on the testing server.  When I open the "local" copy in Dreamweaver, it shows me that some file activity is being done, and then Notepad++ tells me the file has changed and do I want to reload it.  If I do, that extra line vanishes.
    When I check the file activity log, it shows that the file activity is complete.
    I haven't mentioned the production server because it doesn't seem to be affected, but we do have one.

  • Is there a way to open a local file not a web file with actionscript 3.0?

    Reason for asking is because I am making a media player in Adobe Flash CS6, and was wondering if there was anyway to make a button to open a local .fla file in a directory with ActionScript 3.0 or if there are any other ways I can achieve this?
    Thanks Casey

    with an air app, check the file class.  otherwise, check the filereference class.

  • Opening a PDF File from WebDynpro

    Hello Everyone,
    I have a Webdynpro project and need to create a link on one of the views to display a .PDF document.
    1.  Where should I store the PDF document within the webdynpro project?
    2.  How do I open the PDF file?
    I've created a link with action on the view and just need to know how to open it.
    Thanks in advance for your help.
    Mike

    Hi Mike,
    You can try one of the following methods:
    Method 1:
    1. Create a context attribute (say pdfsource) of type binary.
    2. Create a file download control
    3. Attach this attribute to the data property of file download control.
    4. In the init method of the view or in some other method store the content of the pdf in the context attribute. And do the following code
         IWDAttributeInfo attInfo = wdContext.currentContextElement().node().getNodeInfo().getAttribute("pdfSource");
         ISimpleTypeModifiable type = attInfo.getModifiableSimpleType();
         IWDModifiableBinaryType binaryType = (IWDModifiableBinaryType) type;
         binaryType.setFileName("Test.pdf");
         binaryType.setMimeType(WDWebResourceType.PDF);
    5. Now on click of File Download link, it will ask for "Open", "Save", or "Cancel" dialog box. You can choose open to open as a pdf document.
    Method 2:
    1. Write an action on click of the button or so.
    2. In that action get the contents and store it in an byte array and open the pdf file directly as follows.
         byte[] PDFbytes = <source string>.getBytes();
         if(PDFbytes!= null) {                                IWDCachedWebResource pdffile= WDWebResource.getPublicCachedWebResource(                    PDFbytes ,                                 WDWebResourceType.PDF,                            WDScopeType.CLIENTSESSION_SCOPE,               wdThis.wdGetAPI().getComponent().getDeployableObjectPart(),
                    "Some Title");                             wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdffile.getURL(), "Some PDF").open();
    Thanks and regards
    RK

  • Error opening URL-local files-mac

    I'm using a var and an Array code on an empty move clip. The code is set on an "Actions" layer. The code checks good. All files are on my desktop.
    When I test movie I get 'Error opening URL 'file:///Andrea/Users/user/Desktop/BosigerWk6/swfs/one.swf'
    I'm on Mac running CS3. Flash setting is set to "Access local files only" I searched hours for a solution to this problem.
    Please help. Here's the code:
    //your swf list can be anything and any length. I named them one two three so you can easily test that it works
    var swfList:Array = new Array("one.swf", "two.swf", "three.swf", "four.swf", "five.swf", "six.swf", "seven.swf", "eight.swf", "nine.swf", "ten.swf", "eleven.swf", "twelve.swf", "thirteen.swf", "fourteen.swf", "fifteen.swf", "sixteen.swf", "seventeen.swf", "eighteen.swf", "nineteen.swf", "twenty.swf");
    var i:Number = 0;
    loadMovieNum(swfList[i], 1);
    //where next button has an instance name of 'nextBtn'
    nextBtn.onRelease = function(){
        i++;
        if(i > swfList.length - 1){
            i = 0;
        trace(swfList[i]);
    //your load funtion here like loadMovieNum(swfList[i], 1); or instance name.loadMovie(swfList[i]);
    //where previous button has an instance name of 'prevBtn'
    prevBtn.onRelease = function(){
        i--;
        if(i < 0 ){
            i = swfList.length - 1;
        trace(swfList[i]);
    //your load funtion here like loadMovieNum(swfList[i], 1); or instance name.loadMovie(swfList[i]);
    Thanks you so much,
    Andrea Bosiger

    I had a problem to test my movies locally in Flash Professional CS5, too. When I turned off the encryption on my Mac, the problem went away.

  • I can NOT open php local file

    Hi every body,
    when i try to open a Local php file from safari or any other browser, i get the following message :
    Forbidden
    You don't have permission to access /~user/Forkan.org/index.html on this server.
    Please note that i already enable apache and php server as in the Photo..
    Thanks for any clear and useful help...
    (i am running OS 10.8.2)

    thanks,
    in the attached photo, the file index.html is one of many files Unreadable with the ext .html and .php also...
    in fact, after i update to 10.8.2 i read the following article :
    http://coolestguyplanettech.com/downtown/install-and-configure-apache-mysql-php- and-phpmyadmin-osx-108-mountain-lion
    and i did all the instructions inside...
    Please note that when i put : localhost
    in my browser, i really get :
    It works!
    But each time i put :
    http://localhost/~user/Forkan.org/index.html
    http://localhost/~user/Forkan.org/Movies.php
    http://localhost/~user/Sample.php
    and also :
    http://localhost/~user/phpinfo.php     (like the file in the article after i made that file and put it correctly of course)
    each time i put that i get :
    Forbidden
    You don't have permission to access /~user/phpinfo.php on this server.
    Many thanks for any Help...

  • How do I open a local file on the computer?

    I use FF 25.0.1 to log onto my EMC VNX5300 JAVA console so that I can administer the SAN. One of the functions is to create reports on the SAN usage. The SAN console writes the files to the local computer and uses the browser to open and display the file. Here's the address bar of one of my reports:
    file:///C:/Users/MyName/emc/Unisphere/Reports/7.32.2.0.36/ArrayConfig.html?xml=file%3A///C%3A%5CUsers%5Cjmilano%5Cemc%5CUnisphere%5CReports%5CFCN00131500068_UMReport_12-17-2013_15-58-21.xml
    <sub> '''edit'''repeated used smaller text to repeat above, else obscured when I view it ~J99<br />
    file:///C:/Users/MyName/emc/Unisphere/Reports/7.32.2.0.36/ArrayConfig.html?xml=file%3A///C%3A%5CUsers%5Cjmilano%5Cemc%5CUnisphere%5CReports%5CFCN00131500068_UMReport_12-17-2013_15-58-21.xml </sub>
    The report should be a formatted table of data but instead I get a blank window within my tab. If I run the report in IE, it works OK. It looks something like this:
    Storage system: FCN00123456789XML File: ../FCN00123456789_UMReport_12-17-2013_15-58-21.xmlSystem Configuration Viewer revision: 1.2.2.1.0036GeneralConfigurationView ALLIntroductionXML File InformationIntroduction
    The storage system configuration display feature provides an easy-to-understand view of the XML configuration data generated by the storage system. Note that no configuration data for the File portion of a VNX system is included.
    The XML version of the data is encrypted and sent to your service provider.
    The following information is available in each tab:
    How can I get FF to show the report? Thanks.

    Great that it is now working.
    For anyone interested in the slow startup aspect: <br />
    The slow strartup may have a number of causes. One potential method of helping is to reset Firefox, and that does remove Firefox extensions. See
    * [[Reset Firefox preferences to troubleshoot and fix problems]]
    * [[Firefox takes a long time to start up]]
    Firefox may now warn if it takes a long time to start up. ( Introduced with FHR [[Firefox Health Report - understand your browser performance]] )

  • Open a Local File located in a Web Dynpro Project

    Hi, I'm trying to open a file saved in a new folder called (XSLT) created by me in a web dynpro project.
    When I try to do this, the following exception is thrown:
    ...java.io.FileNotFoundException: F:\usr\sap\DEP\JC00\j2ee\cluster\server0\XSLT\sad.xsl (The system cannot find the path specified)....
    The code that tries to load the file is the next:
    Document xslDoc = dBuilder.parse("XSLT/sad.xsl");
    My Question is: what should be the file path that I should use in order to be able to open a file that is saved into a folder inside my Web Dynpro Project, of course, using a relative path...
    Any ideas???

    Felipe,
    Classes from custom folders are not included in build.
    You may place "xslt" under src/packages and acces them via ClassLoader, i.e.
    Document xslDoc = dBuilder.parse
      this.getClass().getClassLoader().getResource("xslt/sad.xsl")
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • How can I get firefox to open a local file on Windows 8.1via File:open?

    I am trying to open a file from the desktop for viewing as a webpage. It is edited in MS Word. When I open the file it just shows the the text of the file, which is html code, it does not run the file as a webpage. How do I get the file to run as a webpage? Thank you.

    Make sure that the file has the .html file extension.
    That should be sufficient.
    Windows hides some file extensions by default.
    Among them are .html and .ini and .js and .txt, so you may only see file name without file extension.
    You can see the real file type (file extension) in the properties of the file via the right-click context menu in Windows Explorer.

  • Can't open local files.

    I cannot open any local files or folders in Firefox.
    I have tried opening the following file types in Firefox: htm, html, txt, pdf, xpi.
    I have tried opening files in the following ways:
    -Drag drop onto Firefox from windows explorer
    -Right click file in windows explorer and open with Firefox
    -Double click files that would be opened in Firefox by default
    -"Open file" from Firefox file menu
    I have experienced this problem in Firefox 3.x and Firefox 4.0. When I try to open a file in Firefox it creates a new tab with the file's path in the address bar but the file does not open.
    Any idea what could be going wrong?
    thanks
    Rob

    You may have an extension (NoScript?) that blocks access to local files.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

Maybe you are looking for

  • ITunes for windows 7 64 bit will not work at all

    Hi, I have a big problem with iTunes thats killing me. So i updated my iphone 4 to IOS 5 and my last version of itunes which was 9. something i forgot... anyways when i had ios 5 i couldnt sync with the itunes cause it was too low version for the ios

  • Can I use a cell value to reference a table on another sheet?

    I'm not sure if this is possible and I have had no luck with searches, here is what I am attempting to do... On my first sheet I have a number of tables, each holding information on a service. Each table is named to match the service name. On another

  • ICal not displaying all events in Month view, leaving unused blank space

    I think this is a bug or bad programming of iCal: In the month view, I have for example a day with 5 or 6 events. When I change the size of the global iCal window, the size of each day is of course changing, displaying more or less of the events on t

  • How to make collapsible pages in a Swing Panel?

    Hi All, I have a JPanel in swing where I want elements which can be collapsed and expanded like in igoogle. These when expanded, can contains inside them subcomponents which can be labels, textfields, lists or trees!! Once collapsed, only the overall

  • Can't download software updates or upload files

    Hello, I'm looking for help with an issue that has plagued me for a while now. My 12" Powerbook can't upload files of any type and I have been unable to perform a software update for some time. The only software updates that work are for Firefox and