By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,254 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

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

P: n/a
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>Please Select Age:</p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p>FirstName: <input name="txtFirstname" type="text" value=""/></p>
<p>Test checkbox: <input type="checkbox" name="chkbTest" value="on" /
></p>
<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.

Jun 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Check the Request.Files collection that directly exposes uploaded files...

--
Patrice
"robert112" <ro*******@tpg.com.aua écrit dans le message de news:
11*********************@e9g2000prf.googlegroups.co m...
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>Please Select Age:</p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
>></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
>></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
>></p>
<p>FirstName: <input name="txtFirstname" type="text" value=""/></p>
<p>Test checkbox: <input type="checkbox" name="chkbTest" value="on" /
>></p>
<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.

Jun 19 '07 #2

P: n/a
On Jun 19, 6:07 pm, "Patrice" <http://www.chez.com/scribe/wrote:
Check the Request.Files collection that directly exposes uploaded files...

--
Patrice

"robert112" <robert...@tpg.com.aua écrit dans le message de news:
1182229083.510391.50...@e9g2000prf.googlegroups.co m...
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>Please Select Age:</p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p><input type="radio" name="rbRadio" class="radiobutton" value="on" /
></p>
<p>FirstName: <input name="txtFirstname" type="text" value=""/></p>
<p>Test checkbox: <input type="checkbox" name="chkbTest" value="on" /
></p>
<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.
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.

Jun 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.