How to access files stored in a portal

Hi All,
I have a file stored in the root directory ..somewhere in root/portalapps/myfile.csv
This is an xl file ...
I want to read the contents of this file and write it on the screen..
even though there is data in my file but i am not being able to read it..
Below is the code i am using...
Here pramFile is the corresponding file in the portal server
//Code
FileInputStream fis = null;
BufferedInputStream bis = null;
DataInputStream dis = null;
try {
     fis = new FileInputStream(pramFile.getAbsolutePath());
// Here BufferedInputStream is added for fast reading.
    bis = new BufferedInputStream(fis);
   dis = new DataInputStream(bis);
// dis.available() returns 0 if the file does not have more lines.
   while (dis.readLine() != null) {
// this statement reads the line from the file and print it to
// the console.
                                   response.write("line is "+dis.readLine());
// dispose all the resources after using them.
     fis.close();
     bis.close();
                dis.close();
     } catch (FileNotFoundException e) {
     response.write("FileNotFoundException");
e.printStackTrace();
     } catch (IOException e) {
response.write("IOException");
     e.printStackTrace();
//END
Here dis.readLine() is giving null
Kindly suggest if there is any mistake in my approach
Thanks Sundeep

Hello Sundeep,
As the Root/Portalapps folder is not accessible, you can only specify yourFilePath to absolute path on your file system
(ex: c:/...../Root/Portalapps/yourfile)
Using file system absolute path is not at all a good idea as the application is not portable to other servers. So my suggesion is to keep this csv file in your Applications webresource path like: ROOT/portalapps/com.yourapplication/csvfile
Now your csvfile is accessible like this: ".../irj/root/portalapps/com.yourapplication/csvfile"
Here is example how to get Image which is in public path:
IResource rs = componentRequest.getResource(IResource.IMAGE,
               "../mimes/mypicture.gif");
image.setSrc(rs.getResourceInformation().getURL(componentRequest));
Greetings,
Praveen Gudapati

Similar Messages

  • Access files stored in Time Capsule via iCloud

    how to access files stored in Time Capsule via iCloud

    Yes, you can remotely access files in the TC..
    Did you read the apple instructions and do them??
    http://www.apple.com/au/support/icloud/back-to-my-mac/
    It does depend on the main router being upnp or NAT-PMP capable.. so the best is if the TC is the main router.. otherwise you may have to manually forward the ports.

  • How i access file which stored at application server .? Is there any fm ?

    Hi,
    How i access file which stored at application server . Is there any function module which provide same funtinality.
    Regards,
    Gurprit Bhatia

    Hi ,
            U need to use datasets for reading data from application server.Do a f1 on dataset,u will get to know rest of the things.
    TRY.
        OPEN DATASET file FOR INPUT IN TEXT MODE ENCODING UTF-8.
      ENDTRY.
      IF sy-subrc = 0.
          READ DATASET file INTO <wa_data> MAXIMUM LENGTH 200.
               move the data in to internal table
        close dataset
    Edited by: A kumar on Aug 21, 2008 1:37 PM

  • How to access my stored files

    How to access my stored files

    You can only transfer contents back, if they are associated with a certain app that takes up documents. If you go to the sync pane for apps and check the lower list of apps, clicking them one by one and check if contents you need are showing on the right hand side.
    Other contants cannot be transferred back, especially synced pictures cannot be transferred back to the computer.

  • Is there a training program for iCloud and how to use it effectively.  I have downloaded the booklet but not sure how I access files, photos saved on iCloud.

    I am trying to understand cloud but have very little information for a non technical person.  Is there any product that I can access that will provide me with step by step details on how to access things stored in Icloud.  I have recenly lost all my data on my external hard drive and thought that I could restore through icloud.

    It doesn't matter whick account you use to download the app.
    You have to sign into the app (or iCloud.com from a web browser on your computer) with his Apple ID & password.
    Find My iPhone will only work if it was enabled in the iCloud settings on the device and it was powered on with a connection to the internet

  • How to access the stored password list of N9 nativ...

    How to access the stored password list of N9 native browser?

    most everything should be listed here.
    there was a way to see the website data and stored information, but not the passwords. they were ************
    you were only able to delete the login information, and unfortunately, since i have not used the device in so long, have forgotten the language.
    so you will have to dig a bit.
    it was a command that you would enter into the browser address bar.
    if it comes to me i will repost, but for now...check here.
    http://talk.maemo.org/showpost.php?p=1104892&postcount=1

  • Mobile Office, how to access files?

    Anyone knows how to access your office documents (xls, ppt, doc etc) from Mobile office???
    Can't see how to "import" or "browse" for files stored elsewhere on my phone. Help!

    same problem ...
    I don't know how  to access my files from the app "office mobile"
    and when I try to synchronize the local files on the device (Nokia N8) it always show me "unknown error"
    but it works perfectly if I open any files (word, powerpoint or excel) from the "file" app ..

  • How to access file from AIX server to windows

    HI all,
    My question is how to represent file folder name of that server
    my file folder in AIX server and i want to access that file in window s machine.
    * is this the right way to represent the data folder in physical schema declaration
    file:///<aix server IP>/usr/oracledi/oracldi/data

    No, it is not. Filename magic alone will not do the job.
    AIX supports NFS (network file system) or you can use samba (implementation of the Microsoft SMB protocol to share resources in Un*x) .

  • How to access file from AIX server

    Hi ,
    I am facing a problem with Aix Machine .
    I want to access the file from AIX server machine .I am in Windows machine.
    Regards
    Raghava

    HI all,
    My question is how to represent file folder name of that server
    my file folder in AIX server and i want to access that file in window s machine.
    * is this the right way to represent the data folder in physical schema declaration
    file:///<aix server IP>/usr/oracledi/oracldi/data
    Regards
    Raghava
    Message was edited by:
    Raghava.java

  • How to access files in a jar file?

    Can anyone tell me how to access a file contained in my jar file?
    I have about 15 classes jarred and deployed as an applet. I want to include in the jar file some .gif files to be used as icons in a tree view. Rather than trying to access them locally with all the security headaches this brings, can I not simply jar them as resources and point to them in my code?
    Any help much appreciated,
    Thanks in advance,
    Chris

    Hello Chris,
    Please read this note taken directly from Sun, from their Java Tutorial/Creating a GUI with Swing/Using Other Swing Features/How to use Icons/Specifying the Image Source (whew!)
    Note:  Applets are supposed to be able to load images from JAR files.
    Currently, however, some browsers can't read images from a JAR file,
    although they do successfully get classes from a JAR file.
    With our applets, we currently hedge our bets by both putting
    the image files in the applet's archive file (the JAR file containing
    the applet's class files) and by putting the image files in the file
    system on the server.
    */So......Do you want to take a chance?
    -Ron

  • How to access documents stored in a pen drive or sd card?

    Hi folks,
    Is there a way to access docs stored in a pen drive through ipads? I know I can sabe docs using clouds , however, I'm interested also in access docs directly from pen drives. Tks, NivaldoT

    A USB pen drive or DS card (using the camera connection kit) can only be used to import photos & videos. Can't be used to export any type of file.
     Cheers, Tom

  • How are wft files stored

    Hi All,
    I have certain doubts about how workflow definitions files(wft) are stored in database
    1. At which location wft files are stored in server.
    2. using workflow builder we can specify the "effective" date and open wft file effective on that date. How it is achieved.
    Edited by: user13481649 on Aug 12, 2011 1:51 AM

    Suppose I make some changes to wft file on 12-aug-2010,
    if I put any date before 12-aug-2010 on effective in workflow builder i dont see the changes.
    How this is achieved?Why you need to do that? Any specific reason?
    ,one way would be system storing different wft files as per some subversion standards?
    But I am not seeing such a thing in directory mentioned by you.
    $ cd $APPL_TOP
    $ find . -name *.wftThe above will return all workflow files you have under $APPL_TOP for all modules.
    Thanks,
    Hussein

  • How to access files on internal hard drive

    My Macbook Pro didn't boot so, after I spoke to one of the Apple advisors, I reinstalled the Mavericks on an external HD I had.
    i Was advised that I will be able to access the files on my internal Hd and be able to copy all and saved them before reinstalling the whole computer/internal hd.
    I did what I was told, and after booting my computer through Mavericks which is on external hd I didn't manage to access the files.
    I went to recovery HD to check in disc utility whether my internal HD is still there and it is. And I can see the information about the HD, number of files and etc...
    does anyone have any idea how to access these files and copy them and save the HD somehow?
    make an image of Hd or something?
    I Made a Genius appointment on 19th and I really need the computer...
    help.

    I had some issues with permissions but I managed to sort it out.
    IM moving files separately, not Hd in whole..
    .Moved the desktop first to try if it works and it did.
    now Im moving the whole Home folder...
    IM hoping I wont have a problem moving the applications..?... my whole Adobe is it and I need it..
    SHall I use the Migration assistant later after reinstalling the internal drive...?
    Thank you so much!

  • How to access the User's login portal ID?

    Hi all,
         How to access the user's portal login id??
       Thanks,
       Anirudh.

    Hi
    Try this
    String loginuser="";
         try{
              IWDClientUser wdUser = WDClientUser.getCurrentUser();
              IUser user = wdUser.getSAPUser();
              if(user != null)
                   IUserAccount acct[] = user.getUserAccounts();
                   if(acct[0] != null)
                        loginuser = acct[0].getLogonUid();
                        strUserid = strUserid + acct[0].getLogonUid();
    }catch(Exception e){
    Kind Regards
    Mukesh

  • Accessing files stored in a folder on portal through application

    Hi
    I have to access the files that are stored in the folder in "irj" folder on portal, through one link.
    the path i gave is:
    <a href= "http://myserver:12345/irj/<folder name>/<file name>">
    but it is not taking this path and gives the error that requested resource not found.
    Can anybody please help in this regard, whether this way is correct or have to specify the path in some other format.
    Thanks & regards,
    Anupreet

    Hi,
    as Dieter stated implicitely, irj/root on the file system is the "root" folder when calling .../irj via http. There is no access to the irj folder by default.
    On NW04, the mapped folder in fact is ...\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root (so there are two irj folders, the second counts).
    Hope it helps
    Detlev

Maybe you are looking for

  • Safari 5.0.5 jquery images do not show or show incorrectly.

    When they do show the size a crop are not correct. I can not duplicate this issue on other macs, only my MacBook Pro. Chrome, FireFox are good.

  • Uml tools for jdeveloper

    hi is there any UML Tools for JDeveloper that works on windows and mac or any one of them that does code engineering and database modeling also ?

  • BEA WLI and Cyclone Activator

    Hi All Has anybody worked on the Cyclone activator along with BEA WLI? I have a scenario where Cyclone Interchange sends across data to an application. The Cyclone activator intercepts these messages (probable EDI AS2 format) and then should transfer

  • Is my Truecrypt running correctly?

    Hi everyone! I just installed Arch, to be strict I switched from Ubuntu after few months. First thing to do after OS installation was to get truecrypt working, as partition with all my precious data is encrypted. I followed steps described in method

  • Fixed Background for Website

    Hi, I'm currently making a website which need a fixed background, sort of like a patterned wallpaper. I need it to extend to any maximum adjustment of window browser. The background has gradient colors in it, so I can't make it repeatable. Can anyone