J
Jason
Hi folks,
I'm trying to create a section of a website with a unique file upload
utility. The problem is that in most code and components I find to
pass multipart/form data, you need to know the number of files
specified to upload. I'm trying to solve this by having one INPUT
TYPE=FILE box, and, using javascript, each time someone selects a
file, it populates one listbox below it.
Once the submit button is pressed, I'm sending the form elements to
another pages that dynamically generates as many INPUT TYPE=FILE boxes
as necessary, submits the form, then tries to pass that data via the
enctype=multipart/form data FORM tag to another ASP page to handle the
data transfers. The code for the second page is as follows:
<BODY>
<FORM NAME=FormUploadFiles METHOD=POST ENCTYPE="multipart/form-data"
ID=FormUploadFiles ACTION=Upload3.asp>
<%
Dim TempVal, i
TempVal = Split(Request.Form("fnames"), " ")
For i = 1 to Ubound(TempVal)
Response.Write "<INPUT TYPE=FILE NAME=FILE" & i & " VALUE=" &
Chr(34) & TempVal(i) & chr(34) & "><BR>"
Next
Response.Write "<INPUT TYPE=HIDDEN NAME=TotalFiles VALUE=" &
Ubound(TempVal) & ">"
%>
<script type="text/javascript"><!--
document.forms[0].submit();
// --></script>
</FORM>
The code above creates the file elements, and submits the form
automatically, but for some reason, it isn't passing the raw data onto
the next ASP page. Does anyone know why this is, or have any better
suggestions for doing this? I'd rather not use a third party
component if I don't have to.
Thanks
-J
I'm trying to create a section of a website with a unique file upload
utility. The problem is that in most code and components I find to
pass multipart/form data, you need to know the number of files
specified to upload. I'm trying to solve this by having one INPUT
TYPE=FILE box, and, using javascript, each time someone selects a
file, it populates one listbox below it.
Once the submit button is pressed, I'm sending the form elements to
another pages that dynamically generates as many INPUT TYPE=FILE boxes
as necessary, submits the form, then tries to pass that data via the
enctype=multipart/form data FORM tag to another ASP page to handle the
data transfers. The code for the second page is as follows:
<BODY>
<FORM NAME=FormUploadFiles METHOD=POST ENCTYPE="multipart/form-data"
ID=FormUploadFiles ACTION=Upload3.asp>
<%
Dim TempVal, i
TempVal = Split(Request.Form("fnames"), " ")
For i = 1 to Ubound(TempVal)
Response.Write "<INPUT TYPE=FILE NAME=FILE" & i & " VALUE=" &
Chr(34) & TempVal(i) & chr(34) & "><BR>"
Next
Response.Write "<INPUT TYPE=HIDDEN NAME=TotalFiles VALUE=" &
Ubound(TempVal) & ">"
%>
<script type="text/javascript"><!--
document.forms[0].submit();
// --></script>
</FORM>
The code above creates the file elements, and submits the form
automatically, but for some reason, it isn't passing the raw data onto
the next ASP page. Does anyone know why this is, or have any better
suggestions for doing this? I'd rather not use a third party
component if I don't have to.
Thanks
-J