ini file access

Discussion in 'Javascript' started by pat, Dec 13, 2003.

  1. pat

    pat Guest

    hi all.

    am trying to find out how to read/load data from an ini file (and save it
    too)

    thanx in advance

    pat
     
    pat, Dec 13, 2003
    #1
    1. Advertising

  2. pat wrote on 13 Dec 2003 at Sat, 13 Dec 2003 23:38:32 GMT:

    > am trying to find out how to read/load data from an ini file
    > (and save it too)


    Certain browsers might be able to read the data into a variable as a
    string (I forget how), but they certainly cannot save it again.
    JavaScript wasn't developed to do that sort of thing.

    Mike

    --
    Michael Winter
    d (replace ".invalid" with ".uk")
     
    Michael Winter, Dec 14, 2003
    #2
    1. Advertising

  3. > am trying to find out how to read/load data from an ini file (and save it
    > too)


    Only if your .ini file resides on the same domain, you can read it by
    javascript in modern browsers. A popular technique is the use of
    iframes:

    <iframe src="C:\YOUR_INI_FILE.INI"></iframe>

    Saving back is not possible. You 'll need a server process for that.

    Bart
     
    Bart Van der Donck, Dec 14, 2003
    #3
  4. Bart Van der Donck wrote:

    >> am trying to find out how to read/load data from an ini file (and save it
    >> too)

    >
    > Only if your .ini file resides on the same domain, you can read it by
    > javascript in modern browsers. A popular technique is the use of
    > iframes:
    >
    > <iframe src="C:\YOUR_INI_FILE.INI"></iframe>


    <OT>

    JFTR:

    If you consider `localhost' a domain and you dare call IE a "modern
    browser" this might work. Generally, not backslashes serve the purpose
    of path delimiters in URIs but forward slashes do. And a URI scheme
    identifier is missing, too, Mozilla/5.0 for example will probably not
    show anything (at least it will only work on Windows.)

    <iframe src="file:///C:/YOUR_INI_FILE.INI"></iframe>

    could work on Windows as well as

    <iframe src="YOUR_INI_FILE.INI"></iframe>

    could do everywhere. However, the former will only work if the
    parent document is accessed via the local file system or if the UA
    is borken/unpatched. AFAIK & IIRC, for Mozilla/5.0 the bug has
    been fixed in rv:1.4 (CMIIW), and thus access from `http:' to
    `file:' is no longer possible.

    > Saving back is not possible. You 'll need a server process for that.


    Just to clarify: Server processes cannot and will not access the
    `iframe' element (since it is rendered client-side), but the
    resource it refers to.

    </OT>


    PointedEars
    --
    apprentice.c - parses /etc/magic to learn magic

    (from the file-3.40 README)
     
    Thomas 'PointedEars' Lahn, Dec 14, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sphinx

    ini file

    Sphinx, Feb 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,380
    Gerry O'Brien [MVP]
    Feb 25, 2004
  2. chapman

    Update INI file problem

    chapman, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    454
    chapman
    Jul 31, 2003
  3. Smitha Patel

    INI or Any Other File..... ?

    Smitha Patel, May 23, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    430
    Brock Allen
    May 23, 2005
  4. MikeVance

    Ini file equivalent ASP.Net etc

    MikeVance, Jan 20, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    607
    Peter Zolja
    Jan 20, 2006
  5. Stephan Kämper

    INI file access from Ruby

    Stephan Kämper, Aug 25, 2003, in forum: Ruby
    Replies:
    2
    Views:
    227
    Stephan Kämper
    Aug 28, 2003
Loading...

Share This Page