Karl,
I made the changes you suggested. Still getting error. Unfortunately all
errors are handled by error handler, actual error is posted to an error
log. Here's what it gives me:
2005-03-03 10:26:05 => System.Web.Http CompileExceptio n: External component
has thrown an exception. at
System.Web.Comp ilation.BaseCom piler.ThrowIfCo mpilerErrors(Co mpilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData, String
sourceFile, String sourceString) at
System.Web.Comp ilation.BaseCom piler.GetCompil edType() at
System.Web.UI.P ageParser.Compi leIntoType() at
System.Web.UI.T emplateParser.G etParserCacheIt emThroughCompil ation()
any of this make sense to you?
my current code:
<%@ Import namespace="Syst em.IO"%>
<html>
<head>
<title>Uploadin g a File</title>
<script language="VB" runat="server">
Dim savePath As String = "D:\Customers\m iller-env\miller_hr\"
Sub Upload_Click(so urce As Object, e As EventArgs)
If Not (uploadedFile.P ostedFile Is Nothing) Then
Try
Dim postedFile = uploadedFile.Po stedFile
Dim filename As String = Path.GetFileNam e(postedFile.Fi leName)
Dim contentType As String = postedFile.Cont entType
Dim contentLength As Integer = postedFile.Cont entLength
postedFile.Save As(savePath & filename)
message.Text = postedFile.File name & " uploaded" & _
"<br>conten t type: " & contentType & _
"<br>conten t name: " & filename & _
"<br>conten t length: " & contentLength.T oString()
Catch exc As Exception
message.Text = "Failed uploading file"
End Try
Dim command As new System.Data.SQL Client.SqlComma nd
Dim connection as new System.Data.SQL Client.SQLConne ction
connection.Conn ectionString = ("server=(local ); initial
catalog=miller_ env; uid=miller; pwd=wat3rt3st")
command = ("update mei_cc_file set filename = @filename", connection)
command.Paramet ers.Add("@FileN ame", SqlDbType.VarCh ar, 255).Value =
filename
try
connection.open ()
command.Execute NonQuery()
finally
connection.clos e()
command = Nothing
end try
End If
End Sub
</script>
</head>
<body>
<form enctype="multip art/form-data" runat="server">
Select File to Upload:
<input id="uploadedFil e" type="file" runat="server">
<p>
<input type=button id="upload"
value="Upload"
OnServerClick=" Upload_Click"
runat="server">
<p>
<asp:Label id="message" runat="server"/>
</form>
</body>
</html>
--
Message posted via
http://www.dotnetmonster.com