FileUpload1.FileName Question

E

Edge1960

I am using Visual Web Developer along with SQLExpress on a WinXP Pro
2002 SP2 machine with a 3.79 GHz processor with 2GB of RAM to create
a
web application for entering data to a database. I am using the
following code to call up a filename into a textbox. I use the
textbox
to add the filename to the database along with other information
gathered on my form.

<script runat="server">
Sub UploadButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)


If (FileUpload1.HasFile) Then
Dim dale As String = (FileUpload1.FileName)


TextBox1.Text = dale


End If


End Sub


</script>


My problem is that there are instances that the filename cannot be
called up. The connection to the server keeps getting reset -


The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try
again in a few
moments.
* If you are unable to load any pages, check your computer's
network
connection.
* If your computer or network is protected by a firewall or
proxy, make sure
that Firefox is permitted to access the Web.


IE gives a similar response.


At first I thought it had something to do with the type of file it
was
trying to get the name from, ie., I got the problem consistently with
files with the .zip extension. I later proved that out as being
incorrect.


When I am sucessful with the filename event, my database updates
correctly.


The filenames I am attempting to retrieve are also on a different
server on the LAN. I am able to use the function to get other
filenames from the same folder with no problem so it doesn't seem to
be a permissions related problem.


I have also copied the file to my desktop and have had no luck
retrieving the filename.


I have been fighting this for days before posting this as I wanted to
give as much information as possible. This, of course, means that I
am
overlooking something very obvious. Let me know what you might think
could be the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top