Re: Programmatic access to HtmlInputFile value it is a runat serve
- From: "msdn" <sql_agentman@xxxxxxxxxxx>
- Date: Tue, 23 May 2006 14:38:33 -0700
If you can populate the File-Path then what prevents somebody else from
putting what ever they want in it and upload any file from the client
machine.
The limitations on the HtmlInputFile are for security reasons and by design,
You should punish the user for not following the rules and ask them to
select the file again. I know this is a hassle but life if tuff.
If you find a solution please let us know.
Otherwise deal with it using ActiveX, Java Applet, or DotNet Compontents
that need security permissions anyway to run on the client side.
I like to see the hack.
Sa
"cindy" <cmello@xxxxxxxxxxxxx> wrote in message
news:F0D45117-D670-4E42-A4A5-A80D9B693D72@xxxxxxxxxxxxxxxx
no not security violation I just want to reload original file so user does
not have to reselect to try upload again. I do not want to change
readonly
of the value just the default behavior of LoadPostData to return false--
cindy
"msdn" wrote:
This looks like a security issue here. you are not allowed to do this.
What happens if I pre-populate your email address book or some important
file on your machine and upload it.
Other options may be an activex, java, or .NET control. again they must
be
trusted.
Sa
"cindy" <cmello@xxxxxxxxxxxxx> wrote in message
news:F2070996-779C-4BAA-9D55-EA16D0127BF8@xxxxxxxxxxxxxxxx
I found this but I don't know enough where to start
............
these controls do not save their viewstate. LoadPostData always returns
false, and the Value property is readonly. You can inherit from the
class
and
override LoadPostData to return true and try to restore the value, but
value
is readonly.
Example to inherit from HtmlInputFile class and override LoadPostData
to
return true I am using C# and this is challenging me bad. cindy
"cindy" wrote:
I have a System.Web.UI.HtmlControls.HtmlInputFile control that I use
to
submit files. Before the file is successfully submitted I validate
another
field on the form, it is the description of the file must be 500
characters.
I am adding the file to a site server library programmatically so if
the
field is too long I want to return the user to the form with file
still
selected in the HtmlInputFile control. I am using an error label to
inform
the user to shorten the description. I do not want the user to have
to
browse again to the same file after he has shortened the description.
Right
now the file does not upload but the control is empty. ASP.NET does
not
let
me programmatically put the full filename and path back into the Value
property of the HtmlInputFile control. How can I do this? I have
version
asp.net 1.1
If there is a better thread to post this in please tell me where. I
have
searched on Google and cannot find anything. Can I "override" the
value
property to add the set? Please help. Cindy
--
cindy
.
- Follow-Ups:
- References:
- Prev by Date: Re: Master pages, how to make them work?
- Next by Date: Add-on control with "edit" capabilities
- Previous by thread: Re: Programmatic access to HtmlInputFile value it is a runat server
- Next by thread: Re: Programmatic access to HtmlInputFile value it is a runat serve
- Index(es):
Relevant Pages
|