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 = isZipFile.read(data, 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
    Arif

    Hi,
    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="10.1.2.0.2">+
    +<!--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 ','"-->+
    +</cache>+
    +<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"/-->+
    +</engine>+
    +...+
    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>+*
    *+<environment id="APP2">+*
    *+<envVariable name="REPORTS_PATH" value="/application2/reports"/>+*
    +</environment>+
    +</server>+
    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
    ADD_PARAMETER(p_list,'ENVID',TEXT_PARAMETER,'APP1');
    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.
    Volker

  • Default directory for file-upload in web.xml

    Hi,
    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
    java.io.IOException: No such file or directory
    at java.io.UnixFileSystem.createFileExclusively(Native 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:
    java.io.IOException: Permission denied
    at java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1314)
    at java.io.File.createTempFile(File.java:1402)
    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.
    <init-param>
         <param-name>tempFileDirectory</param-name>
         <param-value>/home/Basil/myTemp</param-value>
    </init-param>
    Any help is greatly appreciated,
    Regards,
    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 java.io.File 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

    Hi,
    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.
    Regards,
    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.........
    Riz

  • 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::
    http://www.shrubbery.net/solaris9ab/SUNWabe/ADVOSUG/p33.html
    man page here
    http://www.unix.com/man-page/OpenSolaris/4/profile/

  • 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!
    Thanks,
    Akshatha

    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:
    http://www.eclipse.org/callisto/
    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" avoka.com if you want more info.
    Good luck...
    Howard
    http://www.avoka.com

  • 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?
    Thanks.

    Originally posted by: kwarner.uneedspeed.net
    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
    sources.
    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.
    Tia
    Sincerely
    Rolf

    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
    directory.
    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 ?
    Thanks
    Swap

    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!!
    Thanks,
    Amirineni

    Amirineni,
    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
    Rgds,
    CV

    Hi,
    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 .
    haritha

  • 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

    Hi,
    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=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    %>
    Regards,
    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:
    Quick_SQL.vi ‏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: http://www.able-consulting.com/ADO_Conn.htm
    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.
    FF

Maybe you are looking for

  • Stock of a material as on given date

    Hi all,     Is there any function module or any BAPI to calculate the opening and closing stock of a material as on the given date, based on which a customizing report is to be developed.. There was a Transaction MB5B to know the as on date stock, bu

  • GREP Search to apply superscript

    Hi there, I'm a longtime InDesign user but I'm pretty new to GREP. Currently I'm working on a French document, but this could easily apply to English documents as well. I'm trying to use GREP to identify and apply superscript to letters that come aft

  • Default Image

    Hi guys! I have a problem that I can´t solve. I am creating a news script with php and mysql and my problem is that I can´t figure out how to set up a default image for posts that haven´t got a image to add so it would display instead so the field wo

  • Why is my ipod always so slow?

    it is always slow loading things,going back to home screeen, opening internet using apps, slow with safari, appstore,  and itunes store.

  • GR reversal error message E M7 037

    Hi experts we were trying to cancel GR on 30-11-2007. we got the following error message. po no: 0023060608 po item 00010 E M7 037 in plant PN54, post to current period 2007/12. please help me. Thanks & Regards, Ramesh