Click to See Complete Forum and Search --> : Open File Dialog Box in VB ASP.NET WEB APPLN


AvinashG
September 12th, 2005, 06:42 PM
Hello,

Needed help on this guys. I need to create a Open File Dialog Box(To select a *.csv/*.txt file) for a WebForm1.aspx. I see a control OpenFileDialog for a Windows Form, But there isnt one for a Web Form. How do I go about implementing this. Any help on this 1 is appreciated.
Thanks,
Avi

DSJ
September 13th, 2005, 10:32 AM
It's called FileInput or HTLMFileInput or something similar, it's on the HTML Controls toolbar.

AvinashG
September 14th, 2005, 02:18 PM
DSJ, Yes it works with File command

Protected WithEvents File1 As System.Web.UI.HtmlControls.HtmlInputFile
sFileName = File1.Value

all i want is the Path of the file selected which I use in my function to manipulate the contents of the file. but the size of my file i need to select from the open dialog box is more than 5 mb(I just want the path of the file selected.....which i would open and manipulate on)
but whats happening is if the size of the file exceeds more than 4 mb my web browser displays the
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.
----------error.
y is this. or else is there some other way that i can give the user a choice in selecting a file other than the File command.(Coz, all i want is the PATH and the FILE NAME )

AvinashG
September 14th, 2005, 04:24 PM
could get around this problem.....
got the answer on google...
Upload larger files

By default, ASP.NET permits only files that are 4,096 kilobytes (KB) (or 4 megabytes [MB]) or less to be uploaded to the Web server. To upload larger files, you must change the maxRequestLength parameter of the <httpRuntime> section in the Web.config file.

Note When the maxRequestLength attribute is set in the Machine.config file and then a request is posted (for example, a file upload) that exceeds the value of maxRequestLength, a custom error page cannot be displayed. Instead, Microsoft Internet Explorer will display a "Cannot find server or DNS" error message.

If you want to change this setting for all of the computer and not just this ASP.NET application, you must modify the Machine.config file.

By default, the <httpRuntime> element is set to the following parameters in the Machine.config file:

<httpRuntime executionTimeout="90" maxRequestLength="4096" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" />

The Machine.config file is located in the \System Root\Microsoft.NET\Framework\Version Number\Config folder

DSJ
September 14th, 2005, 04:44 PM
You can also change it in the Web.Config file for just that single app, instead of all of them running on that machine.