Form fields

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
 
T

Tim Stephenson

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">
 
K

Kenneth Keeley

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.
 
T

Tim Stephenson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top