?
Solved

Trouble understanding the following error.

Posted on 2004-08-24
6
Medium Priority
?
337 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
Independent Software Vendors: 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 1000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 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