File manipulation in JavaScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Froggy_Jo

    #1

    File manipulation in JavaScript

    I have a split screen HTML display. In the bottom half, I have a
    series of file names with hyperlinks. In the top half, I want to
    display the file selected. However, it seems I can only do this if
    the file has a TXT extension. If this is the case, what Javascript
    could I write which would take the file, copy it to a temporary area
    and rename it as a TXT file. It should then delete the file when I
    select a new file or close the window. Sorry to ask for a solution,
    but I'm not really a Java programmer. I could do it in Fortran!!!
  • Grant Wagner

    #2
    Re: File manipulation in JavaScript

    Froggy_Jo wrote:
    [color=blue]
    > I have a split screen HTML display. In the bottom half, I have a
    > series of file names with hyperlinks. In the top half, I want to
    > display the file selected. However, it seems I can only do this if
    > the file has a TXT extension. If this is the case, what Javascript
    > could I write which would take the file, copy it to a temporary area
    > and rename it as a TXT file. It should then delete the file when I
    > select a new file or close the window. Sorry to ask for a solution,
    > but I'm not really a Java programmer. I could do it in Fortran!!![/color]

    Client-side JavaScript can't manipulate files directly, either on the
    server or on the client.

    If all you want to do is display the contents of a link in the bottom
    frame in the top frame (let's call it "Top") then all you need is:

    <a href="somefile. ext" target="Top">Vi ew somefile.ext in the frame
    above</a>

    Some file types will not display in a frame in a web browser and some
    will on some browsers and not on others. It depends completely on the
    target browser and the applications installed and registered in the OS
    to handle various MIME types.

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    http://msdn.microsoft.com/workshop/a...ence_entry.asp

    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    Working...