File manipulation in JavaScript

F

Froggy_Jo

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!!!
 
G

Grant Wagner

Froggy_Jo said:
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!!!

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">View 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 <[email protected]>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_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-developer/upgrade_2.html
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,016
Latest member
TatianaCha

Latest Threads

Top