Form fields

  • Thread starter Thread starter Kenneth Keeley
  • Start date Start date
K

Kenneth Keeley

Hi
I wish to create a file upload page/s. This page/s should start by asking
the user how many files they wish to upload. When they have entered the
number of files the page/s should then display that many file input boxes
and also display a comment boxes for each file box. I would like this to be
all on one page if possible.
I have started to create a page but have not been able to make the File
input boxes work yet.

Some sample code would be great.
Thanks
 
If by "not been able to make the file input boxes work" you mean that the
file doesn't seem to be uploaded, make sure you've changed the page's form
tag's encType to multipart/form-data.

i.e.
<FORM id="Form1" method="post" runat="server" encType="multipart/form-data">
 
No that part is OK the problem is how to submit the number of files the
person wants to upload and then dynamically make the page have that many
file input boxes and captions before the page gets submitted to the Web
site.
 
One option would be to find out how many boxes the user requires, and then
dynamically add the right number of boxes to the host form or panel using
[container].controls.add(mynewfilecontrol)

You would then need to iterate through the filecontrols and process each
one's file upload in turn.
 
Back
Top