473,397 Members | 1,985 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,397 software developers and data experts.

fileupload - default file?

I want to implement a repetitive admin function of kicking off an operation
using a file that changes infrequently. All I'm interested in is the file
name and path, I'm not performing any file transfer.

I've put a fileupload control on the page to allow the user to specify the
file. Now I want to push/pull the details to/from appsettings so the user
doesn't have to browse to the file if it hasn't changed.

However I can't set default values of filename and hasfile because they are
readonly. Is there a way around this, or should I be using a different
control?

Thanks in advance
David
Feb 1 '06 #1
1 3305
Apparently FileUpload members are readonly for security reasons, so can't
proceed with the approach originally described.

Instead displayed the appsetting filepath in a label and updated both label
and appsetting when user selected a file (myFileUpload.HasFile == true). Got
the full name and path of the file from myFileUpload.PostedFile.FileName

"David Norman" wrote:
I want to implement a repetitive admin function of kicking off an operation
using a file that changes infrequently. All I'm interested in is the file
name and path, I'm not performing any file transfer.

I've put a fileupload control on the page to allow the user to specify the
file. Now I want to push/pull the details to/from appsettings so the user
doesn't have to browse to the file if it hasn't changed.

However I can't set default values of filename and hasfile because they are
readonly. Is there a way around this, or should I be using a different
control?

Thanks in advance
David

Feb 1 '06 #2

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

Similar topics

8
by: VB Programmer | last post by:
I am using a FileUpload control (ASP.NET 2.0). How do I check the length of the file in bytes BEFORE I let them upload it? I believe my code checks now AFTER... If...
12
by: Phil Z. | last post by:
After migrating an ASP.NET 1.1 application to 2.0 we were getting "Cannot access a closed file" errors when uploading. I found a number of post on the subject and have since moved from using an...
4
by: Dave | last post by:
Is it possible to change the default location for the FileUpload control so that it searches a file from within the web page file structure? Even more specific...limit it to one folder within that...
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...
0
by: =?Utf-8?B?TGVvbkc=?= | last post by:
I'm trying to upload a file using an asp:FileUpload control and an asp:LinkButton. This works fine, while there is an actual filepath in the fileupload upload control. Even an empty field works....
6
by: Chris | last post by:
I want do my insert to a database using a formview bound to an objectdatasource. I also want to upload a file. I'm quite new to and this is just test code but Is there any way I can pass the file...
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
6
by: GaryDean | last post by:
Is there any way to make an asp FileUpload control work within an UpdatePanel? Thanks, Garyh
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.