How to open a file on the clients local hard drive from within ASP

Discussion in 'ASP General' started by Peter, Oct 12, 2007.

  1. Peter

    Peter Guest

    Dear,

    I do have an ASP page with vbscript code entirely executed on the IIS
    server. The page contains a lot of data coming from the SQL Server.
    I want to populate one of the <select> boxes on that page with data coming
    from a file stored on the clients local hard drive. How do I achieve this?

    Thanks in advance,
    Regards,
    Peter
    Peter, Oct 12, 2007
    #1
    1. Advertising

  2. Peter

    Evertjan. Guest

    =?Utf-8?B?UGV0ZXI=?= wrote on 12 okt 2007 in
    microsoft.public.inetserver.asp.general:

    > I do have an ASP page with vbscript code entirely executed on the IIS
    > server. The page contains a lot of data coming from the SQL Server.
    > I want to populate one of the <select> boxes on that page with data
    > coming from a file stored on the clients local hard drive.


    > How do I achieve this?


    You don't.

    ASP runs ONLY on the server
    and ONLY sends the computed html to the client.

    Clientside coding, in javascript,
    [or if IE only, also in clientside vbscript]
    could read from the client's hard disk
    ONLY if the security of the browser is compromized.

    This however, besides being unwize,
    is outside the scope of this ASP NG.

    You could say, as many have done before you,
    and you could and should have read in the archive,
    that your application is so important, that it
    is justfied that asp programmers should help you to
    make clientside script, that also is dangerous to the ordinary user
    if it were even possible, but I would not agree with you there.

    So I would urge you not even to search for appropriate NG's,
    but to abandon your quest.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 12, 2007
    #2
    1. Advertising

  3. Peter

    Peter Guest

    Re: How to open a file on the clients local hard drive from within

    Thanks Jan for the answer.
    The goal was to build the drop down list with all 2800 Cities and their
    postcode in it so the user can select the city rather then typing it.
    Problem is that it takes a huge time to download this content from the server
    (SQL data) to the client. It would goes faster if this data was locally
    stored since she would not change in the future. (unless the spilt of HBV
    will cause Flemish cities become Brussels cities, according to the current
    political crisis in Belgium)


    "Evertjan." wrote:

    > =?Utf-8?B?UGV0ZXI=?= wrote on 12 okt 2007 in
    > microsoft.public.inetserver.asp.general:
    >
    > > I do have an ASP page with vbscript code entirely executed on the IIS
    > > server. The page contains a lot of data coming from the SQL Server.
    > > I want to populate one of the <select> boxes on that page with data
    > > coming from a file stored on the clients local hard drive.

    >
    > > How do I achieve this?

    >
    > You don't.
    >
    > ASP runs ONLY on the server
    > and ONLY sends the computed html to the client.
    >
    > Clientside coding, in javascript,
    > [or if IE only, also in clientside vbscript]
    > could read from the client's hard disk
    > ONLY if the security of the browser is compromized.
    >
    > This however, besides being unwize,
    > is outside the scope of this ASP NG.
    >
    > You could say, as many have done before you,
    > and you could and should have read in the archive,
    > that your application is so important, that it
    > is justfied that asp programmers should help you to
    > make clientside script, that also is dangerous to the ordinary user
    > if it were even possible, but I would not agree with you there.
    >
    > So I would urge you not even to search for appropriate NG's,
    > but to abandon your quest.
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
    >
    Peter, Oct 12, 2007
    #3
  4. Peter

    p byers Guest

    Re: How to open a file on the clients local hard drive from within

    Hi Peter
    Just a thought
    Use a "Text" Input box for the PostCode to be typed in
    On Lost focus
    use XMLHTTP to get the City from your Internet server
    that is Fast and the Web Page does not need to be repainted
    - the City name appears where-ever you want it in your page.
    Pete (Northolt UK)

    Peter wrote:

    > Thanks Jan for the answer.
    > The goal was to build the drop down list with all 2800 Cities and their
    > postcode in it so the user can select the city rather then typing it.
    > Problem is that it takes a huge time to download this content from the server
    > (SQL data) to the client. It would goes faster if this data was locally
    > stored since she would not change in the future. (unless the spilt of HBV
    > will cause Flemish cities become Brussels cities, according to the current
    > political crisis in Belgium)
    >
    > "Evertjan." wrote:
    >
    > > =?Utf-8?B?UGV0ZXI=?= wrote on 12 okt 2007 in
    > > microsoft.public.inetserver.asp.general:
    > >
    > > > I do have an ASP page with vbscript code entirely executed on the IIS
    > > > server. The page contains a lot of data coming from the SQL Server.
    > > > I want to populate one of the <select> boxes on that page with data
    > > > coming from a file stored on the clients local hard drive.

    > >
    > > > How do I achieve this?

    > >
    > > You don't.
    > >
    > > ASP runs ONLY on the server
    > > and ONLY sends the computed html to the client.
    > >
    > > Clientside coding, in javascript,
    > > [or if IE only, also in clientside vbscript]
    > > could read from the client's hard disk
    > > ONLY if the security of the browser is compromized.
    > >
    > > This however, besides being unwize,
    > > is outside the scope of this ASP NG.
    > >
    > > You could say, as many have done before you,
    > > and you could and should have read in the archive,
    > > that your application is so important, that it
    > > is justfied that asp programmers should help you to
    > > make clientside script, that also is dangerous to the ordinary user
    > > if it were even possible, but I would not agree with you there.
    > >
    > > So I would urge you not even to search for appropriate NG's,
    > > but to abandon your quest.
    > >
    > > --
    > > Evertjan.
    > > The Netherlands.
    > > (Please change the x'es to dots in my emailaddress)
    > >
    p byers, Oct 13, 2007
    #4
  5. Peter

    Evertjan. Guest

    Re: How to open a file on the clients local hard drive from within

    =?Utf-8?B?UGV0ZXI=?= wrote on 13 okt 2007 in
    microsoft.public.inetserver.asp.general:

    > "Evertjan." wrote:
    >> > How do I achieve this?

    >>
    >> You don't.
    >>
    >> ASP runs ONLY on the server
    >> and ONLY sends the computed html to the client.
    >>
    >> Clientside coding, in javascript,
    >> [or if IE only, also in clientside vbscript]
    >> could read from the client's hard disk
    >> ONLY if the security of the browser is compromized.
    >>
    >> This however, besides being unwize,
    >> is outside the scope of this ASP NG.
    >>
    >> You could say, as many have done before you,
    >> and you could and should have read in the archive,
    >> that your application is so important, that it
    >> is justfied that asp programmers should help you to
    >> make clientside script, that also is dangerous to the ordinary user
    >> if it were even possible, but I would not agree with you there.
    >>
    >> So I would urge you not even to search for appropriate NG's,
    >> but to abandon your quest.
    >>
    >> --
    >> Evertjan.


    [Please do not toppost on usenet]

    > Thanks Jan for the answer.


    [please do not invent another name for me]

    > The goal was to build the drop down list with all 2800 Cities and
    > their postcode in it so the user can select the city rather then
    > typing it. Problem is that it takes a huge time to download this
    > content from the server (SQL data) to the client.


    I do not see why that would take a long time, only 2800 cities cum
    postcode. A file of perhaps 100kB would do, methinks.
    A nice jpeg is larger.
    Do you dial in?

    And it is not even necessary when using AJAX.

    You would not have the user spit through a dropdown of 2800 lines?

    Subidvided by the first two letters AJAX will only need to fetch between
    5 to 20 records.

    > It would goes faster
    > if this data was locally stored since she would not change in the
    > future. (unless the spilt of HBV will cause Flemish cities become
    > Brussels cities, according to the current political crisis in Belgium)


    Which will never happen, they will go over to the Netherlands first. ;-)

    Explanation of the "why" does not help, if something is imposseble.

    However nothing is really impossible, if you think of it:

    The browser cache can be used freely, though inconsistently because of
    the individual settings of the users and browser types.

    Try putting all the data in one .js file as an array of arrays:

    a = [
    ['Brussel','10000'],
    ['Dendermonde','12345']
    ];

    That file need only be loaded once a day or so.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 13, 2007
    #5
  6. Re: How to open a file on the clients local hard drive from within

    "Peter" <> wrote in message
    news:...
    > Thanks Jan for the answer.
    > The goal was to build the drop down list with all 2800 Cities and their
    > postcode in it so the user can select the city rather then typing it.
    > Problem is that it takes a huge time to download this content from the

    server
    > (SQL data) to the client. It would goes faster if this data was locally
    > stored since she would not change in the future. (unless the spilt of HBV
    > will cause Flemish cities become Brussels cities, according to the current
    > political crisis in Belgium)
    >


    To boil the issue down you have a large amount of data that you want to
    transfer to the client and store it locally so that its not retrieved every
    time the page is hit by that client.

    This is what the local browser cache is for.

    Place the postcodes and cities in an XML file (lets call it cities.xml)

    In IIS manager add a Cache-Control header to the file with the value
    "max-age: 900" A 15 minute life time may seem too conservative but its not
    since all it really means is how often a round trip resulting in a 304
    response is generated.

    Now in javascript:-

    // A good implementation would do error checking but this'll work
    function getXML(url)
    {

    if (window.XMLHttpRequest)
    oXmlHttp = new XMLHttpRequest()
    else
    oXmlHttp = new ActiveXObject("MSXML2.XMLHTTP.3.0")

    oXmlHttp.open "GET", url, false
    oXmlHttp.send

    return oXmlHttp.ResponseXML

    }

    If this is the only application you'd have for the XML I would be tempted to
    make your XML look like this:-

    <select id="cboCity" name="city">
    <option value="postcode">City Name</option>
    <option value="postcode">City Name</option>
    Anthony Jones, Oct 13, 2007
    #6
  7. Peter

    jp2code Guest

    Re: How to open a file on the clients local hard drive from within

    This is the Internet, and it is all about freedom.

    "Evertjan." wrote:
    > [Please do not toppost on usenet]
    jp2code, Oct 15, 2007
    #7
  8. Re: How to open a file on the clients local hard drive from within

    Gazing into my crystal ball I observed "jp2code" <poojo.com/mail>
    writing in news::

    > "Evertjan." wrote:
    >> [Please do not toppost on usenet]

    >
    > This is the Internet, and it is all about freedom.
    >


    No, this is Usenet. Please do not top post, otherwise the message looks
    like:

    > No this is Usenet
    >> This is the Internet
    >>> Please do not toppost on usenet


    Now, does the above make any sense? Got it?



    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Oct 15, 2007
    #8
  9. Peter

    Evertjan. Guest

    Re: How to open a file on the clients local hard drive from within

    jp2code wrote on 15 okt 2007 in microsoft.public.inetserver.asp.general:

    > This is the Internet, and it is all about freedom.
    >
    > "Evertjan." wrote:
    >> [Please do not toppost on usenet]


    1
    So freedom is not allowing me to say "please"?
    So freedom is not about asking for adhering to Netiquette?

    2
    The internet is not about freedom.
    Why would you think that?
    The internet is just communication technology.
    It is like saying, that the beach is all about freedom,
    where the beach is just a nicely situated piece of sand.
    Yes the internet can give freedom, just like a wire cutter.

    So:

    [Please do not toppost on usenet]


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Oct 15, 2007
    #9
    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. Laszlo Szijarto
    Replies:
    1
    Views:
    3,284
    Michael Earls
    Jan 23, 2004
  2. mh
    Replies:
    4
    Views:
    700
    Wolfgang Strobl
    May 31, 2005
  3. shailesh
    Replies:
    1
    Views:
    779
    Tim Golden
    Mar 28, 2007
  4. michael
    Replies:
    1
    Views:
    90
    Bret Pettichord
    Oct 15, 2006
  5. Alex
    Replies:
    2
    Views:
    225
    Thomas 'PointedEars' Lahn
    Mar 1, 2006
Loading...

Share This Page