473,503 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!!!
Jul 20 '05 #1
1 5354
Froggy_Jo wrote:
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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* 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
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1534
by: Pjotr Wedersteers | last post by:
Hi, I am building a page that allows people to send in text and/or html files and have them analyzed for several statistics by a serverside PHP script. I'd like the files to be sent zipped or...
3
3018
by: Fabian | last post by:
I have created a javascript to manipulate a text strong given to it. It works in all the situations I put it in. Now, I want to create a form based interface. Essentially, the use types in the text...
9
3338
by: zacariaz | last post by:
I dont know, and i dont much like javascript, however, i am told that the only way to do want i want to do, is with javascript, so here goes. zoom and cut is the only features i need. 1. the...
2
1377
by: Jake Barnes | last post by:
At a certain point in my code, I need to blank the value in a file input. The situation comes up when a user first thinks they want to upload something from their harddrive, but then they change...
1
2710
by: pbd22 | last post by:
hi. i have been posting this here and elsewhere a lot and can't seem to get resolution on this problem. i have been trying to upload files using a hidden iframe to a asp.net/vb.net form. the...
2
3940
by: bsprogs | last post by:
Alright, I'm very new to JavaScript but I'm fair with PHP. I'm working on an uploader script and what I'm trying to do is take the file name from the file input box. I looked at string...
3
3441
by: NobodyImportant | last post by:
Hello everyone! I admit up front that I am new at this and have very little knowledge of JavaScript, but we have an asp web form that allows for the manipulation of letters our company regularly...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7464
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5586
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4680
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3162
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
741
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.