Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Exception has been thrown by the target of an invocation....what is this?

Reply
Thread Tools

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

 
 
darrel
Guest
Posts: n/a
 
      06-09-2005
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


 
Reply With Quote
 
 
 
 
Craig Deelsnyder
Guest
Posts: n/a
 
      06-10-2005
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
 
Reply With Quote
 
 
 
 
darrel
Guest
Posts: n/a
 
      06-10-2005
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
Exception has been thrown by the target of an invocation Matt ASP .Net 1 09-08-2005 04:00 PM
Exception has been thrown by the target of an invocation - The What!? Kivak Wolf ASP .Net 0 06-28-2005 03:49 PM
Exception has been thrown by the target of invocation exception =?Utf-8?B?VmFs?= ASP .Net 0 06-08-2005 05:11 PM
Exception has been thrown by the target of invocation exception Val ASP .Net Security 0 06-08-2005 05:10 PM



Advertisments