×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    52

    How to give permission to WebServer folder

    Hi guys. I am developing a MIDLET and i would like to create a file on the phone WebServer/htdocs folder, in order to put this file on the Mobile Webserver. However,it seems to be neccesary to give permissions to this folder,as when i choose this directory i have a "Security exception:Access denied". It do works with the Data/Image folder,but no with this one.

    Any suggestions?? Thanks a lot!

    nadiuska Let's developing

  2. #2
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Re: How to give permission to WebServer folder

    Hi nadiuska.

    Can't you create the file from the midlet or access the htdocs folder from the web? I guess the first since the Data/Image folder isn't viewable from the web by default, although it could be configured so.

    I'm not familiar with the midlets, so I can't help you there but I guess there might be some sort of security policy preventing creating files in some folders. If there are no Java experts here to help you out, you could try different approach by adding the following lines into your httpd.conf file in Web server/conf folder.

    Code:
    <Directory "C:/Data/Something/">
    # Change 'valid-user' to a specific user or comment the line out if you
    # want to allow access to anybody. This way all users can access this
    # folder with their own username and password.
      Require valid-user
    # Another option to allow only some group, in this case the administrator(s)
    # Require group admin
      AuthType Basic
      AuthName "Private folder"
      AuthUserFile "conf/passwords.txt"
      AuthGroupFile "conf/groups.txt"
    </Directory>
    
    Alias /something/   "C:/Data/Something/"
    This should allow accessing e.g. test.txt file in that folder from web with address http://yoursite.mymobilesite.net/something/test.txt and using that method you could publish some directory that your midlets can write into.

    Configure with your own risk (might also read the Apache manuals first). I can't quarantee that this is 100% secure way, but I think this should be about right... ;-)
    Last edited by jpusa; 2009-03-09 at 11:45.

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    52

    Re: How to give permission to WebServer folder

    Hi jpusa and thanks for replying

    I tried your code but it does not seem to work. I show you what i have done and the exception that the program throws:

    I added to the httpd.conf file the following code:

    <Directory "C:/Data/Web server/htdocs/">
    # Change 'valid-user' to a specific user or comment the line out if you
    # want to allow access to anybody. This way all users can access this
    # folder with their own username and password.
    # Require valid-user
    # Another option to allow only some group, in this case the administrator(s)
    # Require group admin
    </Directory>

    And i have the following exception:

    Security exception:Access denied
    java.lang.SecurityException: Access denied
    at com.symbian.midp.io.protocol.file.FileConnectionImpl.open(FileConnectionImpl.java:66)
    at com.symbian.midp.io.protocol.file.Protocol.openConnection(Protocol.java:40)
    at com.symbian.gcf.ProtocolBase.openConnection(ProtocolBase.java:72)
    at com.symbian.midp.io.protocol.file.Connection.createConnection(Connection.java:20)
    at com.nokia.mj.impl.vmport.J9GcfConnectionBase.setParameters2(J9GcfConnectionBase.java:43)
    at javax.microedition.io.Connector.open(Unknown Source)
    at javax.microedition.io.Connector.open(Unknown Source)
    at hello.Write.commandAction(Unknown Source)
    at javax.microedition.lcdui.Displayable.callCommandAction(Displayable.java:164)
    at javax.microedition.lcdui.Displayable.commandEvent(Displayable.java:137)
    at javax.microedition.lcdui.Displayable.handleEvent(Displayable.java:179)
    at javax.microedition.lcdui.Form.handleEvent(Form.java:277)
    at javax.microedition.lcdui.Toolkit.handleDisplayableEvent(Toolkit.java:536)
    at com.symbian.lcdjava.lang.SystemExtensions._dispatchCallbacks(Native Method)
    at com.symbian.lcdjava.lang.SystemExtensions.dispatchCallbacks(SystemExtensions.java:35)
    at com.symbian.midp.runtime.KVMEventProcessor.run(KVMEventProcessor.java:23)

    Maybe the code must be configured in a .conf file within the emulator,not within the MWS??

    Thanks everybody

    nadiuska Let's developing

  4. #4
    Registered User
    Join Date
    Dec 2003
    Posts
    20

    Re: How to give permission to WebServer folder

    Hi.

    I suggested to do things the other way around. First you find out some directory where you can write into and then configure the web server to expose that directory. Don't configure the htdocs folder if you would like to run also the example web pages as they might stop working then. And if you do, take into account that there are already some configurations for that folder existing.

    If (some of) you find this kind of configuring too hard or unsecure in some way you might also create new folder under the htdocs folder and then use the S60 UI (of MWS) to set access rights for that folder. There's that thing called Folder access for that purpose. But in this particular case it might not help as you have had problems writing to web server folders from Java.

    I edited the code in the previous answer a little bit (after trying out if it works...) so now with those settings at least I managed to share a folder both to valid users and by commenting out that one row, to all without any password queries.

Similar Threads

  1. Problem when moving message from folder to other folder.
    By teyliluo in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-04-07, 09:20
  2. Problem moving messages from folder to another folder
    By teyliluo in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2006-04-05, 14:14
  3. Deleting a folder
    By vinayakak in forum Symbian
    Replies: 1
    Last Post: 2006-03-20, 09:21
  4. How to automatically copy files from soruce folder to BUILD folder
    By etccoch111 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-10-14, 09:13
  5. what is the path to new folder in Nokia 7650
    By zikman9 in forum Symbian
    Replies: 0
    Last Post: 2003-08-03, 08:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×