×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Hyderabad.
    Posts
    99

    problem in writing data into gallery

    hi,
    I had retrieved different type of data from server and trying to write it into gallery but it is not allowing me to write data into gallery showing access denied.
    the code i had written to write into gallery is as follows
    byte[] data;
    FileConnection fConn=(FileConnection)Connector.open("file:///C:/",Connector.write);
    istrm=fConn.openInputStream();
    istrm.write(data);

    here even though Connector.write mode is given i am not able to write the data into gallery.
    it is showing access denied.
    please help me how can i set the permissions to write data into gallery.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: problem in writing data into gallery

    Hi Basu,

    "FileConnection fConn=(FileConnection)Connector.open("file:///C:/",Connector.write);"

    Check this text excerpt:

    "The roots of the file system are device-specific and they don’t necessarily correspond to physical memory units since they are logically defined by the device’s operating system. Furthermore, some Nokia devices support virtual roots that are basically links pointing to certain denoted directories. For instance, the location of captured images in a memory card could be located in the file:///e:/Nokia/Images path under the e: root, but additionally there is an Images/ virtual root which points to the actual physical location. This makes it easier to find such locations and also eases the security permissions, given that a MIDlet may have access rights to the Images/ root but not necessarily to the e:/ root."

    This is from the doc below and I advise you to read it, ok?

    Introduction To The FileConnection API (With Example) v1.1
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

    Hope this helps

    Juarez Jr
    Last edited by juarezjunior; 2006-10-23 at 00:21.
    Juarez Alvares Barbosa Junior - Brazil

  3. #3
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: problem in writing data into gallery

    hi,
    just FYI:
    online version of document Juarez pointed:
    Introduction to The FileConnection API
    regards,
    Peter

  4. #4
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Hyderabad.
    Posts
    99

    Re: problem in writing data into gallery

    hi,
    thank you for your reply i had already read that document(introduction to file connection api).
    the way i had tried out is as follows
    FileConnection fConn = (FileConnection)Connector.open("file:///root1/"+ "team.png",Connector.WRITE)
    and i am able to successfully able to load it into my filesystem root while running on emulator.
    but when i try to download in mobilegallery ex:Nokia 6233 it is showing
    "Access set to not allowed" the way i had tried is as follows:
    String strFolderPath = System.getProperty("fileconn.dir.photos");
    FileConnection fConn = (FileConnection)Connector.open(strFolderPath + "team.png",Connector.WRITE);
    even it is not allowing me to write data into gallery.

    I think i need to set some permissions in midlet sighning for writing data into gallery for nokia 6233.

    so please can any one help me on how can i set permission for 6233 to write data into gallery.

    regards,
    vinod.

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: problem in writing data into gallery

    hi,

    Example for Series 40:

    String url = System.getProperty("fileconn.dir.photos") + "myImage.jpg";

    The Content of the URL is file:///C:/predefgallery/predefphotos/myimage.jpg
    http://www.forum.nokia.com/ME_Develo...79F5BE26E.html
    thats for S40 device like your one,
    have you tried if you at least can READ from that dir at all? (that is if it is withih publicly available dirs on that device),

    regards,
    Peter

  6. #6
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Hyderabad.
    Posts
    99

    Re: problem in writing data into gallery

    hi,
    yes i am able to read all the directories that are present in C:/ and E:/ .
    but when i want to write into those directories it is not all allowing me showing access is denied.
    i think i need some permission to write into the gallery please suggest me what kind of permission i have to set and how for writing into the gallery.
    regards,
    vinod.

  7. #7
    Registered User
    Join Date
    May 2007
    Posts
    2

    Re: problem in writing data into gallery

    Bump....


    I'm having the exact same issue.

    And yes, I've read the documentation. What I need is a human being that can explain a solution in simpler terms instead of just linking to the docs.

  8. #8
    Registered User
    Join Date
    Apr 2003
    Posts
    62

    Re: problem in writing data into gallery

    I haven't used the FileConnection API much at all and it was a long time ago... But a guess:

    Have you tried using Connector.READ_WRITE instead of just Connector.WRITE?

    Since before writing a file in a specific directory you first need read access to the file system in order to determine if the given directory exists or a file with the same name already exists in the given directory...

  9. #9
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    231

    Re: problem in writing data into gallery

    Hi did you check the security permissions settings on your midlet's security menu ? (option->security settings)? the setting for write/modify user data could be different from read user data.
    Are you able to write in another folder creaed by you?
    If not there is the possibility that if your phone is branded, the operator doesn't want someoe to modify data from java apps, and by default the security setting for modify data is unchangable.

    Best Regards

Similar Threads

  1. Replies: 9
    Last Post: 2010-06-10, 12:39
  2. RMS data LOST problem in 3410!!!
    By bitsonic in forum Mobile Java General
    Replies: 6
    Last Post: 2009-03-27, 09:50
  3. File Writing Problem
    By _nomad_ in forum Symbian
    Replies: 2
    Last Post: 2005-04-19, 10:29
  4. Nokia Data Suite 4.05 Problem! HELP PLS!
    By adelelynch in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-05-20, 15:42
  5. Problem: Connect from 7650 to another Device and Receive Data
    By matsguenther in forum Bluetooth Technology
    Replies: 0
    Last Post: 2002-11-11, 14:48

Posting Permissions

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