Solved

Trouble understanding the following error.

Posted on 2004-08-24
6
334 Views
Last Modified: 2008-01-09
Hi

I'm trying to use SoftArtisans.FileUp to upload a text file to the server.  I've used similar code for ASP, but am getting the following error using ASP.NET.  I'm new to this and do not understand the error.  Can someone shed some light?  

The source error points to this line of code...

Line 22: objUpload.Form("file").Save()

The error I'm getting is

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The server threw an exception.


Stack Trace:

[COMException (0x80010105): The server threw an exception.]
   Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) +895
   ASP.process_aspx.Local_Page_Load() in C:\Inetpub\wwwroot\test.trends.fusionmedia.com\process.aspx:22
   ASP.process_aspx.Page_Load() in C:\Inetpub\wwwroot\test.trends.fusionmedia.com\global\scripts\server\common.vbs:14
   System.Web.Util.ArglessEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +10
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731

 

0
Comment
Question by:peerlesslv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 8

Expert Comment

by:trevorhartman
ID: 11884498
put a try/catch block around it and catch the exception that is being thrown.

Try
   objUpload.Form("file").Save()
Catch e As Exception
   Response.Write(e.ToString())
End Try
0
 
LVL 8

Expert Comment

by:trevorhartman
ID: 11884508
this will help you determine what the problem is.  if you need more help just post the results
0
 
LVL 17

Expert Comment

by:AerosSaga
ID: 11884562
why not just use regular asp.net upload?

Regards,

Aeros
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:peerlesslv
ID: 11884671
Interesting point AerosSaga.  I read a little about asp.net upload and just might have to give that a try.

I've spent a little time on this current problem and feel like I just need to get to the bottom of it because its driving me nuts.    trevorhartman, thanks for the try/catch block.  here's what I got:

System.Runtime.InteropServices.COMException (0x80010105): The server threw an exception. at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at ASP.process_aspx.Local_Page_Load() in C:\Inetpub\wwwroot\test.trends.fusionmedia.com\process.aspx:line 24

Any sense?
0
 
LVL 17

Accepted Solution

by:
AerosSaga earned 250 total points
ID: 11884876
just drag the ASP.NET file browser control onto the page and modify this Sub to do what you need it to, save yourself a lot of trouble. I denoted the file saving processes with *****'s

 Private Sub AddProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddProduct.Click
        If Not Page.IsPostBack Then Return

        ProductNameValidator.Enabled = True
        Tier1Validator.Enabled = True
        QueryValidator.Enabled = False
        Validate()

        If Not IsValid Then Return

        Dim cnn As New OleDb.OleDbConnection(ConfigurationSettings.AppSettings("SiteDB"))
        Dim cmd As New OleDb.OleDbCommand
        Dim IncomingFile As IO.FileInfo****
        Dim PriceValue As String
   

        If ImageSrc.PostedFile.ContentLength <> 0 Then
            IncomingFile = New IO.FileInfo(Request.Files(0).FileName)***
            IncomingFile = New IO.FileInfo(Server.MapPath("~/Pictures/Products/") & IncomingFile.Name)****
            Request.Files(0).SaveAs(IncomingFile.FullName)*******
         
        End If


        If Price.Text = "" Then
            PriceValue = "0"
        Else
            PriceValue = Price.Text
        End If

        cmd.CommandType = CommandType.Text
        cmd.CommandText = "INSERT INTO Products (Tier1ID, Tier2ID, Tier3ID, Name, " & _
            "Description, ImageSrc, Price, Weight, Size1, Size2, Size3, Size4, Size5, Size6, Size7, Size8, Size9, Size10) VALUES (" & Tier1.SelectedValue & ", " & _
            Tier2.SelectedValue & ", " & Tier3.SelectedValue & ", '" & ProductName.Text & _
            "', '" & Description.Text & "', '" & ImageSource & "', '" & PriceValue & "', " & Me.txtWeight.Text & _
            ", '" & Me.txtSize1.Text & "', '" & Me.txtSize2.Text & "', '" & Me.txtSize3.Text & "', '" & Me.txtSize4.Text & _
            "', '" & Me.txtSize5.Text & "', '" & Me.txtSize6.Text & "', '" & Me.txtSize7.Text & _
            "', '" & Me.txtSize8.Text & "', '" & Me.txtSize9.Text & "', '" & Me.txtSize10.Text & "')"
        cmd.Connection = cnn
        cnn.Open()
        cmd.ExecuteNonQuery()
        cnn.Close()
        cmd.Dispose()
        cnn.Dispose()
        LoadProductData()
    End Sub
0
 

Author Comment

by:peerlesslv
ID: 11885007
Thanks AerosSaga.  

Much better.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question