Exception has been thrown by the target of an invocation....what is this?

Discussion in 'ASP .Net' started by darrel, Jun 9, 2005.

  1. darrel

    darrel Guest

    I've written a function that will upload a file. This sort of works. It
    works sometimes, and then other times...namely when it tries to write to an
    existing directory (but not always), I get this error:

    Exception has been thrown by the target of an invocation.

    Googling seems to indicate that that's a pretty generic error. Is there any
    way to find out more specifics as to what is causing this?

    The specific line it appears to choke on is this:

    postedFile.SaveAs(savePath & strUploadFileName)

    Again, it works sometimes, not others. Both times, it has the same string.
    I'm stumped.

    -Darrel
     
    darrel, Jun 9, 2005
    #1
    1. Advertising

  2. Re: Exception has been thrown by the target of an invocation....whatis this?

    darrel wrote:
    > I've written a function that will upload a file. This sort of works. It
    > works sometimes, and then other times...namely when it tries to write to an
    > existing directory (but not always), I get this error:
    >
    > Exception has been thrown by the target of an invocation.
    >
    > Googling seems to indicate that that's a pretty generic error. Is there any
    > way to find out more specifics as to what is causing this?
    >
    > The specific line it appears to choke on is this:
    >
    > postedFile.SaveAs(savePath & strUploadFileName)
    >
    > Again, it works sometimes, not others. Both times, it has the same string.
    > I'm stumped.
    >
    > -Darrel
    >
    >


    Is it when the file already exists? Perhaps it won't automatically
    overwrite the file on the filesystem.....or make sure you the aspnet
    account has Delete/Modify access in Windows to the target folder, as
    creating a file is different permission than deleting/modifying. dunno...

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
     
    Craig Deelsnyder, Jun 10, 2005
    #2
    1. Advertising

  3. darrel

    darrel Guest

    > Is it when the file already exists? Perhaps it won't automatically
    > overwrite the file on the filesystem.....or make sure you the aspnet
    > account has Delete/Modify access in Windows to the target folder, as
    > creating a file is different permission than deleting/modifying. dunno...


    It's something like that. If the folder/directory exists it pukes with that
    error. I'm guessing it is a permissions issue, but everything seems OK.

    -Darrel
     
    darrel, Jun 10, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VmFs?=
    Replies:
    0
    Views:
    3,155
    =?Utf-8?B?VmFs?=
    Jun 8, 2005
  2. Kivak Wolf
    Replies:
    0
    Views:
    810
    Kivak Wolf
    Jun 28, 2005
  3. Matt
    Replies:
    1
    Views:
    3,560
    Clamps
    Sep 8, 2005
  4. Replies:
    1
    Views:
    933
    PlatinumBay
    Jun 6, 2007
  5. Val
    Replies:
    0
    Views:
    196
Loading...

Share This Page