Chmod / File permission when creating directory

Hello,
I'm updating an existing website that is developed by someone else.
One of the scripts is used to upload files and is written in JSP (while all other pages are PHP). In this script, a directory is created using following code:
File uploadDir = new File(folder);
if (!uploadDir.exists()) {
uploadDir.mkdir();
This creates a folder with the following arguments: drwxr-xr-x (nummeric: 755).
This means that only the owner has write-permissions... In another script, the same directory must be used to store some more files. This script is written in PHP and can't access the folder to write.
How can I chmod / set permissions so the group can also write (775)? Using the first JSP-script...
Thanks in advance.
Greetz,
l:x
lx(at)lxit.be

There is no way in java to change the umask of mkdir because to do so is platform-specific.
Either have a separate daemon process look for directories and change permissions, change the default umask of the user the script executes as, or drop to a system call with Runtime.getRuntime and execute chmod yourself.
[this post written from a unix perspective: change terminonolgy as appropriate for windows]

Similar Messages

  • How to specify the database file path when create FDM application

    Dear All,
    How to specify the database file path (MSSQL) when create FDM application?
    Right now, all data file are placed in the D:\ . I want to specify the database files (log and mdf file) in other place. How to do it?
    Thanks.

    Where is the highS2.xml located on the disk? If you add it to your project you should set its Build Action to Content and its Copy To Output Directory to Always in Visual Studio:
    Please remember to close your threads by marking helpful posts as answer once your issue has been solved and then start a new thread if you have a new question.

  • File permission when upload the file on HP-UX

    hello,
    There is noe program is written to upload file from local machine to unix/linux server at location /app/test/.
    Both directory has rights 777. owner of the test directory is lets "xyz"
    Now written program upload file as "xyz" user at location /apps/test/.
    The file permission of uploaded file if -rw-r-----
    Now my problem is - i want file permission -rw-r--r--
    I cant give rights manually everytime with chmod command.
    Is there any other way to change file permission of uploaded files????
    output of umask of "xyz" user is 000
    The same code is working properly on linux but i m getting different file permission on HP UX
    Thank you....

    Multipart request is not handled as www request.
    UploadBean might help you :
    http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html

  • How do i have adobe X pro encrypt word files automatically when created.

    how do i have adobe X pro encrypt word files automatically when created

    Hi sbuckton,
    Sure, you can encrypt your document while converting it. However you will have to use your Microsoft office for that.
    Please refer to the above screenshot & follow the steps :-
    1) Open Microsoft word with your word file.
    2) Click on the 'Acrobat' tab on the top.
    3) Then choose the Create PDF option form below.
    4) A pop up window will appear asking you to save the file as PDF, however before saving the file click on the 'Restrict Editing' option.
    5) Again a pop up window will come up on your screen, you can choose for the Encryption method & password protection option in order to secure the document.
    6) Once done, Save the file.
    In case if you still experience any issue please let us know.
    Regards,
    Aadesh

  • Files required when creating add-on installer exe

    Dear All Gurus/Experts,
    I couldn't find out and almost give up to create installer of add-on. The add-on created using VB6. It is UI API addon (I know it based on answers to several add-on topic posted to this forum).  When I want to create installer exe, I use 3 files : application.exe (vb exe), AddOnInstallAPI.dll and EndInstall.exe (vb exe). In the installer software, there is a feature named include installer that could be tick or not.  Is this correct ? is it only application file required to create the installer ?
    I appreciate your answers. TIA
    Rgds,

    You can use B1DE setup wizards also for addons built with VB6 or any other
    language. It just takes the name of your addon files (executables / dll / etc) and
    builds for you a B1 addon setup. Just as easy.
    Regarding your thoughts about easiness of producing addons. This is exactly the
    objective of B1DE. It contains several wizards to generate automatically code (in
    C# or VB.NET) for your addons and shield you from all the needed mechanics
    related to SDK.
    And the tools do not stop only with development. You can download from here
    also certification tools, profilers, browsers, test automation, etc etc etc. Go
    under Business One SDK tools and download them. Several thousands of SDNers
    already did.

  • RH crash or new files corrupt when creating template

    TCS2
    FM 9.0.3
    Robohelp 8.0.2
    My template project keeps crashing Robohelp or corrupting the projects when i run the template script.
    Deleting the linked Framemaker files then running the script eventually leads to a crash.
    Running the script without deleting the linked Frame files creates a corruption of the project and when lanching anew project with the corrupt template a report notifies that there is a corrupt xml file.
    This is a propblem i keep returning to. We haven't yet started using Robohelp for producing output but we have now been playing on and off for three months with the tool. We are still using our old Help tool and FM 7.2. We need to start going into production. Please help.
    All responses greatly received
    Rob

    Why are you saving as jpeg for print out of Illustrator? Work in CMYK and save as pdf.
    Working in CMYK means that, provided your monitor is calibrated correctly, what you see is what you get.
    You may be in for an unpleasant surprise if you work in those nice, bright RGB colours and they come out all dull and muddy when printed.
    Pdf means that vector art remains as vector art. It is bad Latin to pixellate things when you don’t need to.

  • Files disappear when creating a new folder

    I'm new to mac....got a macbook this week. I'm in Iraq so I have very limited access to anything. No internet for my mac at the moment...so I can't update even if there are ones. I assume I have the currenct version of everything though. The question...
    While switching over my files I decided to reorganize them. I'm working on my external HD and creating many new folders for all my files. On numerous occasions now (4) I have created a new file the standard way...right click>new>file...then named it. On these occasions I have done this it has renamed the previous file I had worked in (even though it was not selected) and then the contents of the file disappeared. This leaves me with the new file I created and another identical file of the same name...now with nothing in it. Some of my files I have backed up, but the last one deleted many videos that I didn't. Happens randomly at no particular time. If I select the file and view its contents often it will briefly change its name back to the original name, but still nothing in it. Then next selection of anything will switch it back. Have not been able to fine the files anywhere. Tired of losing my files. Any ideas??? Thanks.

    Hi Craig and Welcome to Apple Discussions....
    First of all, thank you for all you are doing. It's so appreciated! Just be safe and come home soon.
    Now... I have a feeling your external hard drive is the culprit. Read here:
    Changing the names of items
    You can easily change the name of a file, folder, or disk on your computer.
    IMPORTANT: To avoid problems using Mac OS X or applications on your computer, don't move or change the names of folders that came with your system (such as the Library folder or your home). You should also not change the names of applications or items associated with specific applications. If you accidentally change the name of an installed item and you experience problems, you can change the name back.
    Locate the item you want to rename on your desktop or in a Finder window.
    Click the item to select it, then click the name. The name is highlighted and you will be able to edit it.
    Type the new name and press Return.
    Some document names have a file extension, such as ".txt" or ".jpg." If you change the name of a file and delete the extension, some applications may no longer recognize the file. To ensure the file can be recognized by the application that created it, change only the part of the name that comes before the extension, or open the file using the appropriate application, then save the file with a new name.
    You cannot change the name of an item in the Finder window's sidebar. You must locate the item on your desktop or in a Finder window to highlight and change the name.
    And more here:
    Getting information about files and folders
    You can view and modify information about files, applications, and volumes in the Info window. This information can include:
    Comments that Spotlight can search on
    Who can view and modify the item.
    The applications that can open it.
    Metadata that describes a file's contents and how it was created. For example, a photo's Info window may contain the picture's dimensions, exposure time, and the make and model of the camera.
    To see information for one or more items, select the items and choose File > Get Info. An Info window opens for each selected item.
    To see a summary of information about several items, select the items then hold down the Control key as you choose File > Get Summary Info. A window summarizes information on all selected items, including their total size.
    To see information about each item as you select it, select one of the items then hold down the Option key as you choose File > Show Inspector. An Inspector window displays information on the selected item. When you select another item, the Inspector's contents are replaced with information on that item.
    I realize that's a lot to digest and your time might be limited. This is something that only takes a few minutes and might help immediately.
    Go to MacintoshHD/Applications/Utilities and locae Disk Utility. Launch DU, select MacintoshHD in the panel on the left and then click: Repair Disk Permissions. Depending on the size of your drive, it should only take a few minutes. When it's finished, Quit Disk Utility from the Menu.
    Here's how to find out exactly which Mac OS you are running. Click the Apple logo top left of your screen then click, About This Mac. A pane will open. Just under "Mac OS X" will be the version number. ie., 10.4.x
    Reboot your MacBook and see if this helps.... I'm retired and have time... if you need one on one help e-mail me: [email protected]
    It's the least I can do
    Carolyn

  • Insufficient Permission When Creating Standby

    I have a remote server which I believe I have prepped appropriately. I have installed grid infrastructure /w ASM, and database software. I have created a virtually blank initMyDB.ora file with a single parameter (db_name) as per docs. I start that skeletal database instance in NOMOUNT mode.
    I go to RMAN and try to connect to the primary as SYS. It connects easily.
    I try to connect to the local instance as SYS. It gives me the "ora-01031 insufficient privileges" error.
    I can, of course, log into +ASM and change the SYS password/change permissions/etc, but I cannot log into the skeletal instance and do anything to SYS as the db is in NOMOUNT mode.
    I'm a Data Guard newcomer, so what am I doing wrong? DB is 11r2 and OS is RHEL 5.
    Thanks

    893968 wrote:
    I have a remote server which I believe I have prepped appropriately. I have installed grid infrastructure /w ASM, and database software. I have created a virtually blank initMyDB.ora file with a single parameter (db_name) as per docs. I start that skeletal database instance in NOMOUNT mode.
    I go to RMAN and try to connect to the primary as SYS. It connects easily.
    I try to connect to the local instance as SYS. It gives me the "ora-01031 insufficient privileges" error.
    I can, of course, log into +ASM and change the SYS password/change permissions/etc, but I cannot log into the skeletal instance and do anything to SYS as the db is in NOMOUNT mode.
    I'm a Data Guard newcomer, so what am I doing wrong? DB is 11r2 and OS is RHEL 5.
    ThanksHi,
    In a Data Guard configuration, all physical and snapshot standby databases must use a copy of the password file from the primary database,
    and that copy must be refreshed whenever the SYSOPER or SYSDBA privilege is granted or revoked,
    and after the password of any user with these privileges is changed.
    Regards
    Mahir M. Quluzade

  • "this is not a valid PDF file" message when creating a new document?

    Every time i try and open a new document I get a message that says this is not a valid PDF file?
    Has anyone else recieved this message?

    Sorry, I am out of ideas. Unless anyone else can help I suggest you need to contact support directly. It’s usually possible to start a live chat, if an Adobe agent is free, and often to get problems fixed right away.
    To get help now click here for product support

  • Where are the files stored when creating a package using CCPLauncher????

    I just bought Captivate 7 for Windows. I need help in installing the software. I downloaded the CCPLauncher.exe and specified all the options to build a package, however, I ran out of disk space on the drive. So I quit the CCPLauncher.exe and want to start this again on another computer that has more space. However, I want to clean up whatever the space the Build process has consumed, but I couldn’t find where the files that took all my disk space were…the CCPLauncher.exe is only 2.5MB. But I loss much more space than that. Note: I’m building the Pacakge on Windows 2003 STD server, but I specified 64-bit ver because I’m going to deploy the package on Windows 8 computer.

    Hi CalvinNova,
    Below is the location for Both Windows and Mac:
    Windows Location - C:\Users\<username>\AppData\Local\Adobe\CCP\AdobeCCPCache
    MAC Location - ~/Library/Application Support/Adobe/CCP/AdobeCCPCache
    Regards,
    Romit Sinha

  • Bridge MUST KEEP ORIGINAL FILES NAMES when creating a web gallery.

    My clients use the galleries I create to download higher resolution images, and now Bridge decides to randomly rename the output images with arbitrary numbers? REALLY? Why on earth would Bridge even NEED to do that? So stupid, please fix, pronto.

    I agree.
    The web gallery is useless this way.
    Fix needed asap!
    wim

  • Getting correct field length when creating formats for delimited flat files

    Using Data Services 3.2 to pull in tsv and Excel source files.
    When creating a new format for each file, DS tries to intelligently set the field size for each column. However, it seems to sample only a portion of the file. The end result is that it often determines too short a length for a field.
    Is there a way to force it to scan an entire file before it sets the field length? Or alternatively, how to get it to at least throw an error instead of silently truncating my data?

    I am not aware of any way to force DS to scan the whole file, or to log a warning when it truncates.  The field sizes DS sets by using a sample of the data is only really to give you a starting point, you need to try and determine the maximum possible lengths preferably from someone who understands the source of the data or through profiling.  But the profiling method will obviously only be based on the data you have at the time of profiling, new data added to the source later could exceed the field lengths.  The way I prefer to handle this is to set all the field lengths to longer than expected, eg. varchar(999) and then use a validation transform immediately after reading the file to check for any fields that exceed the maximum allowed for the target system and send these to an error file/table.

  • FILE.IO.PERMISSION and SOCKET.PERMISSION when calling jdev proxy from DB

    Hello everybody,
    i deployed a webservide proxy (made in jdev 10.1.3.2) to an oracle 10gR2 database. Invoking this proxy works very well when calling it (as a procedure in the database) on the same machine as the DB is running.
    But when trying to invoke the procedure remote on the DB-server from another pc i get 2 error messages (randomly):
    java.security.AccessControlException: the Permission (java.net.SocketPermission 192.168.20.1:1521 connect,resolve) has not been granted to VECOZO. The PL/SQL to grant this is dbms_java.grant_permission( 'VECOZO', 'SYS:java.net.SocketPermission', '192.168.20.1:1521', 'connect,resolve' )
    java.security.AccessControlException: the Permission (java.io.FilePermission \\WEBFS01\WEBFS01_Vecozo\Temp\Acc\MAY07 read) has not been granted to VECOZO. The PL/SQL to grant this is dbms_java.grant_permission( 'VECOZO', 'SYS:java.io.FilePermission', '\\WEBFS01\WEBFS01_Vecozo\Temp\Acc\MAY07', 'read' )
    I gave this permissions in the sys schema to the vecozo schema following the example the error produces for me, but it doesnt work! When i grant socketpermissions on the port secified by the error and i run the proxy again the db comes up with the same error, only with a different port number. I'm getting crazy here. Also the granting of the file.io permission seems to have no result.
    What is strange is that it all works when invoking the proxy locally (from the pc as where the db is running). I think this is because locally you dont need socketpermissions (as sockets are primarily for communication with other pc's). Furthermore i did not even grant the file permission when working locally in my testenvironmentand it all worked just fine. so i dont know why i suddenly need this permission when invoking the procedure on the productionserver from an external pc.
    Can somebody plz help me with this????
    greetz,
    Kim

    Anybody :)

  • Error message when creating new document

    I am using Photoshop CS5 on OSX 10.6.8. When I try to create a new file or copy and paste within an open file, I receive this error message: "This is not a valid Portable Document File (PDF) document. It cannot be opened." This does not occur when opening files, only when creating a new document or working within an open document. I have tried deleting preferences and resetting all warning messages but nothing has worked. Help!

    My first guess would be that something is busted with your global PDF handling, meaning OSX' own Preview and printer stuff. I believe there's an option to turn off this behavior that Apple introduced with OSX 10.6.x, but as a non-Mac person I can't be more specific than that....
    Mylenium

  • Permission to create file in directory

    Hi all,
    I want to check permission in directory. ie. if user have permission to create a file in directory.
    how can i check this.
    for testing i wrote this program and i disabled all permissions for user (like read, write ) from security tab of directory properties.
    so i was not able to open the directory
    but it seems that canRead and canWrite are not working
    public class Check {
          * @param args
         public static void main(String[] args) {
              File s = new File("c:/testing/thisdir");
              if (s.exists() && s.isDirectory()) {
                   System.out.println("exists");
                   if(s.canRead()&& s.canWrite()){
                        System.out.println("read n write possible");                    
                   }else{
                        System.out.println("read n write impossible");
              } else {
                   System.out.println("does not exists");
    Output :
    exists
    read n write possibleAny comments why its so...

    hi dcminter ,
    just now changed the code ... and rechecked the permissions also ... and found that program is unable to write file inside directory...it throws following exception "java.io.IOException: Access is denied"
    but still
    canRead and canWrite method returns true ... i dont know why it is so
    public class Check {
          * @param args
         public static void main(String[] args) {
              try {
                   File s = new File("c:/testing/thisdir");
                   if (s.exists() && s.isDirectory()) {
                        System.out.println("exists");
                        if (s.canRead() && s.canWrite()) {
                             System.out.println("read n write possible");
                        } else {
                             System.out.println("read n write impossible");
                        File ss = new File("c:/testing/thisdir/a.txt");
                        ss.createNewFile();
                   } else {
                        System.out.println("does not exists");
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
    }

Maybe you are looking for

  • [solved] Package invalid errors

    I'm trying to fix a system that died in the middle of a `pacman -Syu` (via `pacman -Qenq | -S -`) and I'm having a ton of problems with packages begin invalid. I've set my clock and cleared the cache several times, and I'm still getting invalid signa

  • Javac missing (?) from SDK install

    Any help appreciated: I installed the 5.0SE SDK. When attempting to compile a source code file, I received the message: 'javac' is not recognized as an internal or external command, operable program or batch file. After some research, I properly set

  • Home page...its purpose

    Folks, What is the purpose of a home page? If the answer is dependent on whether once uses tabs or a navigation list. Let me state that in this case its tabs. For a nav list. I think page 1 is where the nav list would go? However with tabs I am not s

  • TCA - How to define/convert Contact Person Name???

    Hi Guys, We have a requirement in our implementation where we need to define "CONTACT PERSON NAME" along with defining the contacts like Phone numbers, emails etc.... We are using API - " hz_contact_point_v2pub.create_contact_point" to create a conta

  • How to pause a imported .swf logo?

    I've exported a 3 seconds turning Logo (.swf file, done by After Effect) Pls tell me how to pause the logo after it had fly out (in a 10 seconds slide)? I've tried to pause the logo in After effect till 10 seconds but the .swf export file size is HUG