473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

FileUpload Control

bsm
Hi,

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

May 2 '07 #1
8 7224
I want to Set asp:fileupload Filename at runtime.

You can't for security reasons.
May 2 '07 #2
"bsm" <se*************@saksoft.co.inwrote in message
news:11**********************@o5g2000hsb.googlegro ups.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

May 2 '07 #3
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.

"bsm" wrote:
Hi,

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

May 2 '07 #4
bsm
On May 2, 3:43 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"bsm" <senthilmurug...@saksoft.co.inwrote in message

news:11**********************@o5g2000hsb.googlegro ups.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?

May 2 '07 #5
"bsm" <se*************@saksoft.co.inwrote in message
news:11**********************@l77g2000hsb.googlegr oups.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

May 2 '07 #6
bsm
On May 2, 4:31 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"bsm" <senthilmurug...@saksoft.co.inwrote in message

news:11**********************@l77g2000hsb.googlegr oups.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.

May 2 '07 #7
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" <se*************@saksoft.co.inwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
On May 2, 3:43 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
>"bsm" <senthilmurug...@saksoft.co.inwrote in message

news:11**********************@o5g2000hsb.googlegr oups.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?

May 3 '07 #8
bsm
On May 3, 3:23 pm, "Kevin Spencer" <unclechut...@nothinks.comwrote:
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.inwrote in message

news:11**********************@l77g2000hsb.googlegr oups.com...
On May 2, 3:43 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"bsm" <senthilmurug...@saksoft.co.inwrote in message
>news:11**********************@o5g2000hsb.googlegr oups.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?- Hide quoted text -

- Show quoted text -
Thanks for the information.

May 4 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Uncle Ben | last post by:
How strong and reliable is the new ASP.NET 2.0 FileUpload control? By that, I mean is it reliable enough to accept 2-gigabyte file uploads per upload session? Also, is it possible or easy to...
2
by: Paolo | last post by:
Hi to all, I have an error that drove me crazy. Try the following page that should only allow to upload a file: <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">...
1
by: Harinath | last post by:
Hi All, I am working on a portal using .net2.0. In one of my page, i have FileUpload control. I am doing some server side validation for form fields in general. if there is any validation...
3
by: rn5a | last post by:
The ASPX FileUpload control displays a TextBox along with a 'Browse...' Button. Setting the different properties of this control just reflects the changes in the TextBox but not the Button. For...
1
by: Nathan Sokalski | last post by:
I have an ASP.NET 2.0 webform which includes both a FileUpload contol and a Calendar control. When the user selects a new data with the Calendar control, the FileUpload control is reset (there is...
5
by: =?Utf-8?B?QmVydA==?= | last post by:
Hi How can you set the filename property in the asp:fileupload control? How can you persist the value of the chosen filename between postbacks? thanks B
3
by: Nathan Sokalski | last post by:
I have a FileUpload control which is inside an UpdatePanel which is inside a TabPanel. In my code, I use the FileUpload's HasFile and FileContent.Length properties. However, after I select a file,...
6
by: GaryDean | last post by:
Is there any way to make an asp FileUpload control work within an UpdatePanel? Thanks, Garyh
0
by: bharathreddy | last post by:
How to format FileUpload control. As far as I am consurned there is no direct formating available for formating FileUpload Control using css. I will share one of my ideas where I implemented this...
3
by: bharathreddy | last post by:
I am using updatepanel in my application and fileupload control...there is no way to customize the look and feel of the fileupload control so what i have done is kept an image on top of the browse...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.