By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Nov 19 '05 #2

P: n/a
> 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
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.