Solved

Trouble understanding the following error.

Posted on 2004-08-24
6
329 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
  • 2
  • 2
  • 2
6 Comments
 
LVL 8

Expert Comment

by:trevorhartman
Comment Utility
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
Comment Utility
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
Comment Utility
why not just use regular asp.net upload?

Regards,

Aeros
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:peerlesslv
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks AerosSaga.  

Much better.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now