473,804 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3325
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.H asFile == true). Got
the full name and path of the file from myFileUpload.Po stedFile.FileNa me

"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
20206
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 FileUpload1.PostedFile.ContentLength > ConfigurationManager.AppSettings("MaxVideoUploadSize") Then lblErr.Text = "File needs to be > 0 bytes and less than " & ConfigurationManager.AppSettings("MaxVideoUploadSize") / 1000000 & " MB." Exit Sub
12
15678
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 Html File Input control to using the new FileUpload control. Previously, I had set the maxRequestLength attribute in the machine.config file to allow 100MB uploads with success. In the v2.0 application I have added an httpRuntime node to the...
4
7207
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 web structure?
1
3270
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 missing control comes back to the user. All other fields in the screens are retaining their values, but the
3
5178
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 e.g. if the BackColor of a FileUpload control is set to blue, then only the TextBox color changes to blue but the BackColor of the Button doesn't change to blue. Or if the Font-Size of a FileUpload control is set to 15pt, then only the size of the...
0
1578
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. But a bogus filename results in the "Access Denied" javascript error in IE7. This also happens when I use an asp:Button with the UseSubmitBehavior property set to false. When the UseSubmitBehavior is set to true (default), the button does...
6
7347
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 as a byte array and manipulate it in my business object. Currently what I have is this, but my byte array in my business object is nothing. It's like it's not passed the file as a stream. I think I am not binding the FileUpload to the...
5
12086
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
2088
by: GaryDean | last post by:
Is there any way to make an asp FileUpload control work within an UpdatePanel? Thanks, Garyh
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.