hm.. how do I dynamically load multiple html fileuploaders?

R

robert112

This is quite a hard one guys.
***Some necessary back ground Info***

I have an asp.net 1.1 application that uses a WYSIWYG to return some
html created by the user in the admin section of the application. The
html that the user creates is a survey or form made up of textbox's,
radio buttons and drop downs. The form gets saved to a sql database
which then can be viewed on the front end of the application. The way
I do this is have a label on the page and set it's text property to
the html.
This works well but has it's limitations.
This means that I do NOT have programmatic access to these controls
because
a) their not server side html controls
b) their not web controls.

They are purely 'text'. I collect the values by looping through the
request.form collection and do any data validation or processing by
finding out the name of the control in question using the
system.string.indexof method and basically just using string
manipulation to do any work needed.

***Now the problem***
Business requirements now require the user to be able to also include
multiple html file upload elements on the form page. Because this is
not a .net web control or server side html control I don't have any
object's I can work with.

Normally you would access the 'saveas' method of the htmlfileinput
class to save the stream onto hard disk right?

Well I do not have an object to call the saveas method on nor did I
have the luxury of creating the element during runtime. It's dynamic!
Infact, during runtime the only way I can see that there is a html
input file element on the page is from the following command in the
debug command window:

? CType(Page.Controls(2).Controls(5).Controls(4), Label).Text
This brings me back the label control that is in the web user control
that sits on the page. here is some live test data:

<p>&nbsp;</p>
<p><input type="file" name="hfFileUploader" /></p>"

as you can see I want to let the user upload a file through the html
element "htFileUploader" but I don't have any handles to any objects
to call save as on.

Also, I cannot access the upload stream through request.form either.

I am out of ideas and any alternatives, hacks or work arounds would be
greatly appreciated.

Thanks,
-Robert.
 
R

robert112

Check the Request.Files collection that directly exposes uploaded files...

I don't know wether to be happy or sad, your solution worked but I
only saw it after it was too late and implemented a work around!

thank you very much. I never knew about this request.files property.
Silly me, it makes logical sense to look in the request collection for
incoming data. that includes properties other than those that return
form data!

once again, Thank you.
 

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
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top