Loading ...
Sorry, an error occurred while loading the content.
 

local file processing with browser

Expand Messages
  • Alec Burgess
    (moved from ntb-clips) Jody (or others) If I have a file path on my local hard-drive (say) C: Temp any_old_file.htm is there a way to use
    Message 1 of 5 , Jul 27, 2003
      (moved from ntb-clips)
      Jody (or others)

      If I have a file path on my local hard-drive (say) C:\Temp\any_old_file.htm
      is there a way to use
      http://localhost/--?-something-?---_/temp/any_old_file.htm or
      http://127.0.0.1/--?-something-?---_/temp/any_old_file.htm
      that will get the browser to process the file as http:// instead of file://

      Reason: I've run into some programs that seem to refuse to work when I try
      to get them to act on a local file even when all the processing -starts from
      / is done by- a local program (eg. NetSpider) not from something on the net
      (eg. babelfish translation) that clearly needs to be able to get to the page
      via its URL

      Part (most?) of the problem is that I'm not very clear on what the
      differnces are between different protocols (?-right terminology-?) eg. http,
      file, gopher, https in terms of what gets done and how and when they can be
      used and when not.

      Regards ... Alec
      --

      ---- Original Message ----
      From: "Jody" <av1611@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Saturday, July 26, 2003 20:14
      Subject: Re: [Clip] Jody's toy

      ... <snip>
      >
      > FWIW, This works for me in IE (in the address bar) and stays the
      > same: file:///G:/kjb1611/html/download.htm
      >
      > I tried with a path that has spaces in it, but it made no difference
      > opening in IE from its address bar: E:\Program Files\index.htm
      >
      > Opera converted E:\Program Files\index.htm to:
      > file://localhost/E:/Program Files/index.htm
      >
      > Mozilla converted the same (filling in the spaces %20) to:
      > file:///E:/Program%20Files/index.htm
    • Stefan Elssner
      Hi Alec, ... Yes. 1. You will need a webserver program running on your local machine. Once properly installed this will answer on calls to http://127.0.0.1/...
      Message 2 of 5 , Jul 27, 2003
        Hi Alec,

        >If I have a file path on my local hard-drive (say) C:\Temp\any_old_file.htm
        >is there a way to use
        >http://localhost/--?-something-?---_/temp/any_old_file.htm or
        >http://127.0.0.1/--?-something-?---_/temp/any_old_file.htm
        >that will get the browser to process the file as http:// instead of file://

        Yes.
        1. You will need a webserver program running on your local machine.
        Once properly installed this will answer on calls to
        http://127.0.0.1/... and most probably also on http://localhost/...

        2. Assumed you have this already up and running,
        to access your files in question there are two options:
        a. Move or copy them anywhere below your webserver's 'Document Root'
        directory.
        b. Set an alias path to the current location of your files in the
        configuration of your webserver. Whether and how exactly this can be
        done depends on the your actual webserver software and should be
        described anywhere in the acc. documentation.

        I personally use Apache on Windows (from www.apache.org). It's
        configuration is saved in the file httpd.conf in the directory
        apache-main-dir/conf, and setting up aliases to directories outside of
        the main 'Document Root' path is as easy as adding a line to this file
        looking like
        Alias /desk/ "c:/windows/desktop/"

        With this I can access any file on my desktop via
        http://localhost/desk/my-file.htm with a webbrowser or any other
        program using the http protocol.

        >
        >Part (most?) of the problem is that I'm not very clear on what the
        >differnces are between different protocols (?-right terminology-?) eg. http,
        >file, gopher, https in terms of what gets done and how and when they can be
        >used and when not.

        The terminology is right, I would say :)
        http is the Hyper Text Transfer Protocol and any program using it asks
        in a special defined way for information and assumes the responding
        program to be answering in a special defined way, all this declared in
        a description -- the protocol. Gopher is similar, and https is just
        http with the addition of a 'security layer' -- the information
        exchange is encrypted, and how this encryption has to be done is again
        declared by the protocol.

        The special spelling http://, https://, gopher:// and so on is just
        the defined way to tell a program that it should use this protocol for
        asking for the information addressed by the remainder of the
        url-string.

        For all I know file:// is just a 'pseudo' protocol, used mainly by
        webbrowser software to access data from the local filesystem as if
        they were delivered by a real webserver. Other programs might need a
        real webserver and real http, local or remote, because they are unable
        to access the local filesystem directly by design.

        Regards
        Stefan
        elssner@...
      • Stefan Elssner
        This is an important addition regarding security! ... and I forgot to mention that this also means that theoratically anybody anywhere with internet access can
        Message 3 of 5 , Jul 27, 2003
          This is an important addition regarding security!

          On Sun, 27 Jul 2003 18:05:27 +0200, I wrote:
          >I personally use Apache on Windows (from www.apache.org). It's
          >configuration is saved in the file httpd.conf in the directory
          >apache-main-dir/conf, and setting up aliases to directories outside of
          >the main 'Document Root' path is as easy as adding a line to this file
          >looking like
          >Alias /desk/ "c:/windows/desktop/"
          >
          >With this I can access any file on my desktop via
          >http://localhost/desk/my-file.htm with a webbrowser or any other
          >program using the http protocol.
          >

          and I forgot to mention that this also means that theoratically
          anybody anywhere with internet access can access any file on my
          desktop now as long as I'm online.

          Running a local webserver is a risk that must be known of and has to
          be managed. Any webserver software I've heard of can be cofigured to
          whom they should answer or not, and this should be done as restrictive
          as possible.

          With the mentioned Apache webserver this is done with an entry in
          httpd.conf again, this time looking like

          <Directory />
          Order deny,allow
          deny from all
          allow from 127.0.0.1
          </Directory>

          This makes apache only responding to calls from 127.0.0.1, i.e.
          localhost.

          The configuration for other webservers might be similar, and again
          should be declared anywhere in the acc. docs.

          Regards
          Stefan

          elssner@...
        • Alec Burgess
          Stephan: Great answer - THANKS! - much becomes clearer now. I ve read about but not paid much attention to webserver program running on your local machine
          Message 4 of 5 , Jul 27, 2003
            Stephan:

            Great answer - THANKS! - much becomes clearer now.

            I've read about but not paid much attention to >>webserver program running
            on your local machine<<

            I'll check out >>Apache on Windows (from www.apache.org)<<

            A further question - once I get beyond the excitement of accessing my own
            pages from my own disk, will I be able to publish URL's to my own site =
            >>your webserver's 'Document Root'directory<< that will allow others to
            access it (at least temporarily) - my URL (URI(?)) - the xxx.xxx.xxx.xxx
            number stays constant for long periods of time (I think because) I'm on 24-7
            thru Linksys router to my ISP.

            From them I get 5 MB for free - but it sounds like this would allow me to
            have as much of my harddrive available through the Web as I want.
            [Yes]/[No]?

            Then the next step becomes to pay some DNS service for the rights to
            www.alecburgess.com and away I go.[Yes]/[No]?

            Regards ... Alec
            --

            ---- Original Message ----
            From: "Stefan Elssner" <elssner@...>
            To: <ntb-html@yahoogroups.com>
            Sent: Sunday, July 27, 2003 12:05
            Subject: Re: [NH] local file processing with browser

            > Hi Alec,
            >
            >> If I have a file path on my local hard-drive (say)
            >> C:\Temp\any_old_file.htm is there a way to use
            >> http://localhost/--?-something-?---_/temp/any_old_file.htm or
            >> http://127.0.0.1/--?-something-?---_/temp/any_old_file.htm
            >> that will get the browser to process the file as http:// instead of
            >> file://
            >
            ... <snip> ...

            > For all I know file:// is just a 'pseudo' protocol, used mainly by
            > webbrowser software to access data from the local filesystem as if
            > they were delivered by a real webserver. Other programs might need a
            > real webserver and real http, local or remote, because they are unable
            > to access the local filesystem directly by design.
            >
            > Regards
            > Stefan
            > elssner@...
            >
            > ------------------------ Yahoo! Groups Sponsor
            >
            >
            >
            > Your use of Yahoo! Groups is subject to
            > http://docs.yahoo.com/info/terms/
          • Stefan Elssner
            Alec, ... Generally, yes. Let s say your Document Root is set to be c: apache htdocs (this again is a configuration done in httpd.conf) and you have a
            Message 5 of 5 , Jul 28, 2003
              Alec,

              >A further question - once I get beyond the excitement of accessing my own
              >pages from my own disk, will I be able to publish URL's to my own site =
              >>>your webserver's 'Document Root'directory<< that will allow others to
              >access it (at least temporarily) - my URL (URI(?)) - the xxx.xxx.xxx.xxx
              >number stays constant for long periods of time (I think because) I'm on 24-7
              >thru Linksys router to my ISP.
              >
              >From them I get 5 MB for free - but it sounds like this would allow me to
              >have as much of my harddrive available through the Web as I want.
              >[Yes]/[No]?

              Generally, yes.

              Let's say your 'Document Root' is set to be c:\apache\htdocs\ (this
              again is a configuration done in httpd.conf) and you have a
              subdirectory 'test' there with a file 'hello.html' in it -- then
              anybody could access this by http://xxx.xxx.xxx.xxx/test/hello.html as
              long as your local webserver is running and allows this (i.e. is more
              loosely configured regarding access from other than localhost than in
              the example in my second mail).

              BTW, the xxx.xxx.xxx.xxx number is called the IP-number (or IP for
              short) of the machine (IP stands for Internet Protocol), while the
              complete address string pointing to the file in question is called
              the URL (Uniform Ressource Locator). (You can think URI as something
              like a synonym for URL, at least for any of us but the real experts, I
              would say... )

              However, _be_warned_ again that running a worldwide accessible
              webserver on your own machine is a potential security risk, as is
              running any widely accessible server program or share. So you may want
              to study some regarding documentation and have a look at security
              alerts and patch announces on apache.org from time to time. At least
              Apache for Win98 (as I use for local developing and testing) is
              explicitly suggested NOT to be run in production environments / public
              web services.

              >Then the next step becomes to pay some DNS service for the rights to
              >www.alecburgess.com and away I go.[Yes]/[No]?

              Again, generally Yes.

              You will need to use some kind of dynamic DNS service though to cope
              with periodic changes of your IP. How exactly this works is beyond my
              experience, but you could have a look at www.dyndns.org as a starting
              point.

              Regards
              Stefan

              elssner@...
            Your message has been successfully submitted and would be delivered to recipients shortly.