I send you this example for modify second var and html text on fly before submit.
<html>
<HEAD>
<TITLE>test upload</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
<SCRIPT LANGUAJE="JavaScript">
<!--
function update(element) {
document.TheForm.TheFileName.value=element.value;
document.TheForm.OnlyFileName.value=element.value;
V1.innerHTML="Path : [" + element.value + "]";
V2.innerHTML="Filename: [" + element.value + "]";
var tmp = "";
var i = element.value.length;
if ( i == 0 ) return;
for ( i = 0 ; i<element.value.length ; i++ ) {
var car =element.value.charAt(i);
tmp =tmp+car;
if ( car == "\\" ) tmp ="";
if ( car == "\/" ) tmp ="";
}
document.TheForm.OnlyFileName.value=tmp;
V2.innerHTML="Filename: [" + document.TheForm.OnlyFileName.value + "]";
}
//-->
</script>
</HEAD>
<BODY>
<hr>
ARG TheFileName =[<@ARG TheFileName>]<br>
ARG OnlyFileName=[<@ARG OnlyFileName>]<br>
<hr>
<FORM NAME="TheForm" ACTION="<@CGI><@APPFILE>" METHOD="POST"
ENCTYPE="multipart/form-data">
File: <INPUT TYPE="FILE" NAME="TheFile" onKeyup="update(this)" onChange="update(this)"
onBlur="update(this)">
<INPUT TYPE="HIDDEN" NAME="TheFileName">
<INPUT TYPE="HIDDEN" NAME="OnlyFileName">
<p id="V1">Path : []</p>
<p id="V2">FileName: []</p>
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>
Edmundo Valle
[EMAIL PROTECTED]
CASHBOX, S.L.
SPAIN
-----Mensaje original-----
De: stephenyoung [mailto:[EMAIL PROTECTED]]
Enviado el: s�bado, 07 de diciembre de 2002 20:38
Para: Multiple recipients of list witango-talk
Asunto: RE: Witango-Talk: File Upload
I have played around with the idea of extracting the filename out of the local path.
I thought you might be able to do it by using a script to loop through the string and
store the location of each '/' or '\', you could store the final location and extract
only the substring from there on. This really isn't that complicated of an idea, I'm
sure you've thought of it, but doing it might be a pain. I'm going to be looking at
it this week, if I get it to work (or you do...) share share share
Stephen Young
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf
Of Campbell, Steve V.
Sent: Friday, December 06, 2002 3:04 PM
To: Multiple recipients of list witango-talk
Subject: Witango-Talk: File Upload
Haven't we all seen a lot of post's on this list concerning file uploads? I have been
using the file upload taf that has been available at the old Pervasive developer site
and the variant of said file at Ben's goodies page.
The upload taf allows you to browse out to the file and then it records the pathway in
the first empty field. Then in the second empty field you copy the "file name" that
you are uploading.
I need to find a way to do away with the second field. I have tried to parse out the
file name alone and haven't had much luck. I have also tried to do away with the file
name field all together but can't get around the errors.
Anyone had any luck with the above mentioned? Thanks in advance for any help on this.
Steve Campbell
Application Developer/Web Manager
OU Physicians Group
OU College of Medicine
800 Northeast 15th Suite 601
Okc, Ok. 73104
Office 405.271.4647..54163
Pager 405.690.9703
Fax 405.271.1217
Cell 405.226.4901
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
with unsubscribe witango-talk in the message body