How to set a root directory for file management in web application

Is it possible to set a default root directory for file management for a web application ?
We would upload some files and store them in the web server.
When we write the uploaded files without any path, the files are written in the config directory into the jdeveloper embedded oc4j directory.
When we write the uploaded with a relative path ("/somedir/filename"), the files are written in C:/somedir/filename.
We would like that all file management with relative path into the web application refer automatically to a given root directory (for example defined in web.xml).
Is it possible ?

I'm using the standard upload in adf faces.
The problem is not during upload. This is managed in a temporay directory defined in web.xml. The problem is for writing the file that was uploaded (upload give us an inputStream we have to write somewhere, eventually after unzipping).
Here is an example of our current code.
if (mimeType.equals("application/x-zip-compressed") |
mimeType.equals("application/zip")) {
File destZipFile =
new File(rootDirectory + "/" + parametersDirectory +
"/" + uploadedFile.getFilename());
BufferedInputStream isZipFile =
new BufferedInputStream(uploadedFile.getInputStream());
FileOutputStream fosZipFile =
new FileOutputStream(destZipFile);
BufferedOutputStream bosZipFile =
new BufferedOutputStream(fosZipFile, BUFFER);
// read and write until last byte is encountered
while ((currentByte =, 0, BUFFER)) !=
-1) {
bosZipFile.write(data, 0, currentByte);

Similar Messages

  • How to set the working directory for reports in linux

    Hi All,
    Can you anyone help me to set the working directory for oracle application server 10g reports? I am using RHEL4 and AS10g. Actually i want to run my reports from my define
    working directory. How can I do this?
    Thanks in advance

    your rep_srv.conf should look like something like
    +<?xml version = '1.0' encoding = 'ISO-8859-1'?>+
    +<!DOCTYPE server PUBLIC "-//Oracle Corp.//DTD Reports Server Configuration //EN" "file:D:\oracle\FRHome_1/reports/dtd/rwserverconf.dtd">+
    +<server version="">+
    +<!--Please do not change the id for reports engine.-->+
    +<!--The class specifies below is subclass of _EngineClassImplBase and implements EngineInterface.-->+
    +<cache class="oracle.reports.cache.RWCache">+
    +<property name="cacheSize" value="50"/>+
    +<!--property name="cacheDir" value="your cache directory"-->+
    +<!--property name="maxCacheFileNumber" value="max number of cache files"-->+
    +<!--property name="ignoreParameters" value="parameter names to be ignored in constructing cache key, separated by comma ','"-->+
    +<engine id="rwEng" class="oracle.reports.engine.EngineImpl" initEngine="1" maxEngine="3" minEngine="0" engLife="50" maxIdle="30" callbackTimeOut="90000" jvmOptions="-Xmx512M -Xss512K">+
    +<!--property name="sourceDir" value="your reports source directory"/-->+
    +<!--property name="tempDir" value="your reports temp directory"/-->+
    +<!--property name="keepConnection" value="yes"/-->+
    some more definitions
    +<!--pluginParam name="proxy" type="file">proxyinfo.xml</pluginParam-->+
    +<pluginParam name="xmlpds" type="file">xmlpds.conf</pluginParam>+
    +<pluginParam name="jdbcpds" type="file">jdbcpds.conf</pluginParam>+
    +<pluginParam name="textpds" type="file">textpds.conf</pluginParam>+
    *<environment id="APP1">*
    *+<envVariable name="REPORTS_PATH" value="/application1/reports"/>+*
    *+<environment id="APP2">+*
    *+<envVariable name="REPORTS_PATH" value="/application2/reports"/>+*
    The environment ids you can choose yourself and you have to put them in there yourself too (here I put two environments for two different applications "1" and "2").
    If you call a report from Forms, then you have to code something like
    Details depend on how you call your reports, my example is for using a parameter list and calling a report out of application1
    Hope that helps.

  • Default directory for file-upload in web.xml

    Does any one know how to specify a relative path for the temporary directory in the web.xml file.
    In the web.xml file under the jato_MultipartFormFilter filter I tried to change the name of the directory so that it reflects a relative path but it did not work. The deployment process gives the following exception:
    Failure creating test file in directory "tmpDir"; disabling temp file for uploads No such file or directory
    at Method)
    When I tried to keep the default setting, i.e. keeping the tag empty. The server gives a permission denied since I am not accessing as the root user as shown next:
    Root cause: Permission denied
    at Method)
    The only thing I can do is specifying an absulte path from the root directoy '/' in my machine, not the root directory of the application.
    Any help is greatly appreciated,
    Basil mahdi

    Todd and I discussed this last night. We did not seem to have included support for automatic detection of a relative path entry. We have issued an RFE for this. There is little that we can do if the file location cannot be opened due to permission problem. If the temp file feature does not work for your web application then I suspect this is an issue in the application server; perhaps a misconfiguration or security policy issue. If you would like to indicate a path relative to context root then we have a workaround for you. Please use the call <ServletContext>.getRealPath("/"); and then append you relative path. This is essentially what we will end up doing when we implement the RFE. regards -matt-

  • Default directory for FIle Manager

    I am working on file manager for my final year project. I am using jsp, Tomcat and Linux as OS.
    The question is,
    "Is there any way to authenticate users from OS(linux or windows 2000) and how can i set user home directory(e.g. home/sahsan/) to my file manager default directory"
    I really appreciate if anybody help me in this regard. I am ready to read any article,tutorial or even any book chapter for this purpose. Coding Help will be best choice ;-)
    Thank you.
    Syed Ahsan

    I am not sure, i am in search of the code as well. pls let me know if u come across something. i will keep u posted if i know some.........

  • How to setting the root user profile?

    It seems that I can't fine any complet manual to introduce how to setting the root user profile file which locate at /etc/profile? Who can help me find out or figure it out

    first /etc/profile is a global profile for the system
    its not only specific to root
    from here you can configure the system wide paths
    Regardless of the shell you are using, when you first log in your system generally runs the system profile file, /etc/profile. This file is generally owned by the system administrator and is readable (but not writable) by all users.
    After your system executes the system profile, it runs the user profile. The user profile is one (or more) initialization files that define your working environment. For example, if you're in the CDE environment your system checks this file (or set of files) each time you start a new terminal or window.
    refer this::
    man page here

  • Setting up class root directory for application server

    Hi all,
    When i try to deploy my Ejnterprise java bean in sun one application server i get ar error dialog box " plz consult online assistance for setting class root directory" while loading the class files.I tried online but in vain.Can any one tell me how to set up the class root directory in sun one app server platform edition 8.
    But i had many other beans b4.suddenly m encoutering this problem from past 2 3 days.Kindly help me.
    Waiting for ur replies!

    Hi Eric and Jennifer
    A couple of answers to your questions:
    1. LC Forms is just an API - you have to build your own web application (or some other type of application) if you want your users to be able to interact with PDF forms.
    2. You can use Eclipse to build web applications. It's just one of many tools for doing so, but it's a fantastic development environment, and it's free.
    3. Lomboz no longer exists. It has been integrated directly into Eclipse as one of the sub-projects, "WebTools". The easiest way to install web tools is via the Callisto "packaging". This makes sure that you get all the right versions of everything you need. See:
    4. The tutorial mentioned still provides some useful information, although names have been changed.
    5. There are lots of books about developing Web Apps in Java, using servlets or JSP.
    6. FormsIVS is just a small sample application that allows you to test rendering or prepopulating a form. It's not intended as an end-user product.
    7. If you're interesting in some assistance, we do provide training, mentoring, and turnky application development. Send an email to info "at" if you want more info.
    Good luck...

  • I want to find the root directory for a png file on my Macbook air

    I am using html to make a website and want to use a png on my macbook but need the root directory for the image source. I am not sure how to get this, can anyone tell me how?

    If you are hosting a web server from your Mac, you should place the images inside /Library/WebServer/Documents or inside your user Sites folder. The www user will not be able to access a file from anywhere else unless you give it permission to do so.

  • How do I set the default folder for file - open file... ?

    When I save a file, photo, etc., the default folder for OPENING a file becomes the last folder I SAVED to - even after closing and reopening Firefox. Is there a way to maintain the same default folder for opening files?

    Originally posted by:
    Well... I found over 200 bugs none of which seemed to talk about setting
    the default folder. I probably missed the relevant bug in the spew.
    I ask a question here as a last resort -- after I've done what I think
    is an appropriate search for answers.
    But thanks for your help in any case.
    Daniel Megert wrote:
    > DemonDuck wrote:
    >> When I need to open a file not in the workspace, I use File -> Open File.
    >> But the default folder it opens is in C:\Documents and
    >> Setting\Administrator
    >> I would like File -> Open File to first open in someplace more
    >> reasonable -- like the workspace.
    >> How do I set the default folder for File -> Open File ????
    > Is your '?' key broken? Check bugzilla there's a feature request
    > regarding your question.
    > Dani

  • Sun ONE Studio 4 aka Forte: How to set the output path for classes ?

    Help !
    Beginner's question:
    Sun ONE Studio 4 aka Forte:
    How to set the output path for classes ?
    As default, the class files are created in the same directory as the
    In opposite, both JBuilder and Together support that there is a tree
    with the sources and another tree with the classes.
    The first answer I got was "not possible with Forte, but just if you write your own "ANT Build script" !
    a) Please point me to a ready-to-use ANT script for this purpose, if such is available
    b) Is using ANT instead of the MAKE as comfortable ? Besides the separation of sourcecode and classes, I would like to keep everything else to be the same, i.e. I don�t want to edit the ANT file if I enlarge the project by directories or files.

    You can set S1S's options to place newly created .class files in a specific location.
    Identify the compiler that is being used - Open the S1S's Tools/Options window, expand Editing and select Java Sources. Note the Default Compiler value. (If it's one if the Ant options, you use Ant to specify this option, not S1S.)
    Open the S1S's Tools/Options window, expand Building/Compiler Types and select the appropriate compiler.
    The Properties tab of the compiler has the property Target, which sets the filesystem where the compiler output is directed. If you choose <not set>, the .class files are written to their source directory.
    When you set the Target, your change affects all classes that use this compiler.
    Very few options can't be set in S1S; the challenge is finding out where they're set!

  • How to set the deployment directory ?

    Hi all,
    I am using Sun One Studio 3.0 with iWS6.0.
    For every new application that I write, compile and execute,
    it is getting deployed to the same
    Because Sun One Studio is always using the same directory,
    for every application I have
    to manually delete the deployment directory.
    Is there any way to set different deployment
    directory for every new application that I write ?
    If yes, how to do this ?

    I dont have the product installed, so I cannot try it right now. But I think the context root is part of the directory name in which the application is deployed. By default the context root is empty. If you change that, your application would be deployed in a different directory. To change context root, right click on WEB-INF node, and select "Properties" from the menu.
    Alternatively, you could try changing the directory name by right-clicking on the web.xml node under WEB-INF. You should see an iWS tab on the property sheet, where you could enter a directory name.

  • How to set the AS2 fileName for outbound Functional Ack 997 auto generated by Oracle B2B

    Hi Friends,
    How to set the AS2 fileName for outbound Functional Ack 997 auto generated by Oracle B2B.
    External Trading Partner is sending the EDI 856 via AS2 URL to our Oracle B2B Server.
    In the inbound 856 agreement, we have checked the option of Funtional Ack and also Functiona Ack handled by B2B is yes.
    We have the outbound agreement which is sending that Functional ack 997 (auto generated by oracle b2b) and we have specified the Outbound AS2 channel of the Partner.
    997 doc is being sent to external partner using AS2 channel, but the filename is generating as '40101'.
    Please can you let me know how to set the AS2 fileName for outbound Functional Ack 997 auto generated by Oracle B2B.
    Appreciate your valuable answers!!

    AFAIK, there is no option to set the file name when the 997 is generated automatically by B2B.
    Alternatively, if this is a must requirement, you can generate the FA from backend and  send to B2B with MSG_TYPE =9. In this case, you can set the header with filename (How to set the actionname property in B2B 11g)

  • How to set the Default values for Info Objects in Data Selection of InfoPac

    Hi All,
    Flat file Extracion:
    How to set the Default values for Info Objects in Data Selection Tab  for Info Package
    ex: Fiscal Year Variant  Info Object having values 'K4' 'Y2' etc  in Flat file
    Initially  default value(not constant)  for this info Object value should be 'K4'  in Info Package
    If I set data selection value for this info object K4 it will retreive records with this selection only? how to handle

    suppose as your ex. if you are having fiscalyear variant in the dataselection tab then specify K4 in the from column, again the ficalyearvariant row and click on insert duplicate row at the bottom . you will get another row . In that enter Y2 in the from column. now you can extract K4, y2 values .

  • How to set custom master page for social/sites.aspx in sharepoint 2013

    How to set custom master page for social/sites.aspx in sharepoint 2013.?
    File path is
    C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\SocialDataStore\SocialDataStoreList\sites.aspx
    Thanks in advance

    You could open the sites.aspx in Notepad or SharePoint designer, and set the master page to your own master page directly via editing:
    <%@ Page language="C#" MasterPageFile="~masterurl/custom.master"      Inherits="Microsoft.SharePoint.Portal.WebControls.FollowedContentWebPartPage,Microsoft.SharePoint.Portal,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    Rebecca Tu
    TechNet Community Support

  • How to set the connection parameters for SQL

    How to set the connection parameters for SQL to access the MS Access database
    Attachments: ‏21 KB
    Doc1.doc ‏45 KB
    db1.mdb ‏112 KB

    Right-click the WINDOWS desktop, choose New->Microsoft Data Link. That will bring up a dialog that allows you to configure and test your database connection. You might connect to the Access database via ODBC or directly via Jet Engine. The Jet Enginge saves you the trouble of creating an ODBC connection on your PC. After you leave the dialog, the "data link" will show up on your desktop as text file. Open it and copy-paste the connection string to your VI.
    This webpage is an excellent resource for connection strings:
    If your application requires users to change the database connection at runtime, you can also include the dialog via ActiveX (MSDASC.IDataSourceLocator).

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.

Maybe you are looking for

  • Major issue! GPU busted! Need help urgently!

    I bought this HP pavilion g6 2230tx  model around 1.5 years back and since then i have experienced quite a lot of problems with it like hdd crash, heatsink failure, motherboard failure. I'd sent it a lot of times for repair and a lot of my money has

  • OS X 10.8.3 Terminal Error After RVM install

    Recently, I have been venturing into unknown territory with Ruby on Rails. I installed Ruby & Rails via; however, after install, it was suggested that I download the LATEST versions through RVM. Thus, I uninstalled railsinst

  • Doubel invoice check

    All Experts, I have the following business case: A vendor has sent me 2 invoices for the same expense, I have set up the necessary checks to catch duplicate invoices. The duplicate check works fine when the document date is the same and gives me a wa

  • How can I read st22 dump in ABAP

    hello, i would like to know if st22 dump info could be read via FMs or Classes. I found a class CL_DUMP_INFO_MANAGER, btu well could not find documentation on it usage. Will be glad if someone can tell me how to retrieve St22 info. - Harish

  • Schedule in PWA cannot be viewed by Team Members

    Hi all Some of my team members cannot view the schedule in PWA using our Project Online service. I have checked the group setting for Team Members and in the My Task category they have access to view the Project Schedule in PWA but they receive a per