Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Asp.Net Programming

FileUpload Control


Hi,

I want to Set asp:fileupload Filename at runtime. When I try to do, it
shows "Readonly" error. Anyway to achieve this.

> I want to Set asp:fileupload Filename at runtime.

You can't for security reasons.

-----------------------------------------------Reply-----------------------------------------------
"bsm" <senthilmurug@saksoft.co.in> wrote in message

news:1178101879.392426.311900@o5g2000hsb.googlegroups.com...

> I want to Set asp:fileupload Filename at runtime. When I try to do, it
> shows "Readonly" error. Anyway to achieve this.

Absolutely not, for fairly obvious security reasons!

Imagine a public website with a hidden FileUpload control which uploaded
people's accounts database, or their Windows password file...

--
http://www.markrae.net

-----------------------------------------------Reply-----------------------------------------------

It is a read-only property and is automatically set by the ASP.NET runtime
when the user posts back the page with uploaded file from the browser.

On May 2, 3:43 pm, "Mark Rae" <m@markNOSPAMrae.net> wrote:

> "bsm" <senthilmurug@saksoft.co.in> wrote in message

> news:1178101879.392426.311900@o5g2000hsb.googlegroups.com...

> > I want to Set asp:fileupload Filename at runtime. When I try to do, it
> > shows "Readonly" error. Anyway to achieve this.

> Absolutely not, for fairly obvious security reasons!

> Imagine a public website with a hidden FileUpload control which uploaded
> people's accounts database, or their Windows password file...

> --http://www.markrae.net

Actually My requirement was-
  I have a File Upload control and one DropDownControl. I set
AutoPostBack is true to my DDL. After choosing Filecontrol, if i
change DDL value. The filename has got reset. which our users don't
like this. Do u have any alternate?

-----------------------------------------------Reply-----------------------------------------------
"bsm" <senthilmurug@saksoft.co.in> wrote in message

news:1178104304.515537.225220@l77g2000hsb.googlegroups.com...

> The filename has got reset.

That's right - the filename won't survive the postback...

> Do u have any alternate?

No.

--
http://www.markrae.net

-----------------------------------------------Reply-----------------------------------------------

On May 2, 4:31 pm, "Mark Rae" <m@markNOSPAMrae.net> wrote:

> "bsm" <senthilmurug@saksoft.co.in> wrote in message

> news:1178104304.515537.225220@l77g2000hsb.googlegroups.com...

> > The filename has got reset.

> That's right - the filename won't survive the postback...

> > Do u have any alternate?

> No.

> --http://www.markrae.net

Thanks for ur immediate support.

-----------------------------------------------Reply-----------------------------------------------
A FileUpload will not retain its' value between postbacks for security
reasons. Therefore, as long as the ListBox doesn't post back, you won't have
a problem.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"bsm" <senthilmurug@saksoft.co.in> wrote in message

news:1178104304.515537.225220@l77g2000hsb.googlegroups.com...

On May 3, 3:23 pm, "Kevin Spencer" <unclechut@nothinks.com> wrote:

Thanks for the information.
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc