Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #38354

Re: Reading a local file from an HTML page

Newsgroups comp.lang.javascript
Date 2020-04-02 18:59 -0700
References <4830286f-4484-49f8-9cda-9a4073ab6502@googlegroups.com>
Message-ID <85ea5172-9e3d-44f4-aec6-65dbe1ffb035@googlegroups.com> (permalink)
Subject Re: Reading a local file from an HTML page
From minajaich@gmail.com

Show all headers | View raw


I think it's better idea, when you just put a link to a file on webpage....

Kristjan
Tel: 372 6861327
E-mail: ro ba m man 20 2 0@ ho t mai l . co m
(Please remove spaces)

neljapäev, 2. aprill 2020 23:29.22 UTC+3 kirjutas dr.j.r...@gmail.com:
> I currently have, in a HTML page
> 
> <iframe class=FYL ID=Iframe style="width:99%; height:270px;">
> </iframe>
> 
> Fram = document.getElementById("Iframe")
> 
> function DiryToIframe(Diry) {
>   Fram.onload = TimeOut ? DummyF : ReadDiryFromFram
>   Fram.src = Diry
>   if (TimeOut) setTimeout(ReadDiryFromFram, TimeOut)
>   }                                                  
> 
> and that function call would, in several browsers, put the
> contents of the file given by Diry, on the same computer, into
> the above iframe element, and I could then do
> 
>   var DIR = Fram.contentDocument.body
>   DIR = DIR.textContent || DIR.innerText // Is latter needed? Yes, IE8
> 
> and the variable DIR would then contain the contents of file
> Diry.
> 
> That now only(?) works in Internet Explorer.
> 
> How do I set about doing that in all up-to-date browsers, disregarding
> IE11 and current Edge, but including the imminent new Edge?
> 
> The whole thing must operate without user intervention, browsing
> for a file name, even if the full name were known exactly, would
> be intolerable.
> 
> Currently, I would be sufficiently sure that the file Diry exists;
> but subsequently I will want to know whether the file does exist
> before/after attempting to read it.
> 
> 
> -- 
>   (c) John Stockton, near London, UK.  Using Google Groups.           |
>  Mail: J.R.""""""""@physics.org - or as Reply-To, if any.             |

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-02 13:29 -0700
  Re: Reading a local file from an HTML page minajaich@gmail.com - 2020-04-02 18:59 -0700
  Re: Reading a local file from an HTML page JJ <jj4public@vfemail.net> - 2020-04-03 20:18 +0700
  Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-03 10:57 -0700
    Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-03 15:24 -0700
      Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-03 17:11 -0700
        Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-04 05:41 -0700
      Re: Reading a local file from an HTML page "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2020-04-04 12:17 +0200
  Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-06 17:01 -0700
    Re: Reading a local file from an HTML page dr.j.r.stockton@gmail.com - 2020-04-13 12:11 -0700
      Re: Reading a local file from an HTML page "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-04-14 10:04 -0700

csiph-web