Jeff,
Thanks for your reply.
I already tried using Session and Application variables. This doesn't
work because the Session (and Application) variables are not updated
by the time the second <script language="JavaScript" runat="server">
gets executed. The ASP engine seems to run each code block in one page
asynchronously:
E.G.
1) <script language="JavaScript" runat="server">
1) <!--#include...--->
1) <script language="JavaScript" runat="server">
....not...
1) <step>
2) <step>
3) <step>
The Session (and Application) variables are only updated WHEN I
refresh the page.
I never solved this dilema, but I did come up with a work-around. I
just coded the whole page in VBScript (a pain-in-the-butt for me since
I mostly use JavaScript) and everything is working now. It seems silly
to me that you can do so much using JavaScript, and then suddenly hit
a road block (e.g. I can't upload a file to the server using
JavaScript). Maybe the next guy will read this and not spend 5 hours
trying to get the code to work using JavaScript?
Thanks,
Nate
Jeff North <jn****@yourpantsbigpond.net.au> wrote in message news:<5f********************************@4ax.com>. ..
On 5 Oct 2004 14:32:46 -0700, in comp.lang.javascript
na**********@cox.net (nate) wrote:
| Hello,
|
| Does anyone know where I can find an ASP server side script written in
| JavaScript to parse text fields from a form method='POST' using
| enctype='multipart/form-data'? I'd also like it to parse the filename.
|
| <form name='form1' method='POST' enctype='multipart/form-data'
| action='sub.asp'>
| <input type='text' name='title1' value='value1'>
| <input type='file' name='file1'>
| </form>
|
| I found a great ASP VBScript for uploading files, but the rest of my
| Web site is coded in ASP using JavaScript and I can't figure out a way
| to immediately pass the text fields already parsed from server side
| VBScript to server side JavaScript.
You might try using a session variable.
| My ASP code looks like this:
|
| <script language="JavaScript" runat="server">
| //I would like to add JavaScript to parse the text field and
| filename of file1 here.
| </script>
| <!--The 3rd party document below parses all fields from the message
| content and uploads any file fields it encounters.--->
| <!--#include file="aspinclude/upload.asp"-->
| <script language="JavaScript" runat="server">
| //Add record here (title1, filename from file1).
| </script>
|
| Thanks For Your Help,
|
| Nate
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------