472,952 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,952 software developers and data experts.

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

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
2 1662
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
2
by: sj via .NET 247 | last post by:
I have a web form <%@ Page Language="vb" AutoEventWireup="false" Codebehind="test.aspx.vb" Inherits="test"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> &nbsp;...
1
by: kanones | last post by:
Hi - I am seeing some performance degradation when I am loading a control dynamically onto a page with multiple other dynamical controls using Page.LoadControl versus dragging and dropping it...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
6
by: TB | last post by:
Hi All: I have this page where a rows / cells are programmatically added to to table by pushing a button. The rows contain a textbox and a associated button. What I want to is to be able to...
2
by: tshad | last post by:
Is there a way to dynamically add in User Controls where I would get the name from a session variable: If I have the following code:...
1
by: jeffejohnson | last post by:
I'm looking to see if anyone has experienced this... I've got a dropdown that I'm populating dynamically and the items include HTML special characters (like &Ocirc;). If I load them from an...
2
by: ajayreddy2105 | last post by:
Hi All, I want to build the xpath expression dynamically in the xsl for for-each. Scenario is like this:: 1. From javascript I am sending the parameters to xsl. 2. In xsl I am taking those...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.