Solved

Trouble understanding the following error.

Posted on 2004-08-24
6
333 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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