|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Exception has been thrown by the target of an invocation....what is this?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 wrote:
Show quoteHide quote > I've written a function that will upload a file. This sort of works. It Is it when the file already exists? Perhaps it won't automatically > 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 > > 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 > Is it when the file already exists? Perhaps it won't automatically It's something like that. If the folder/directory exists it pukes with that> 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... error. I'm guessing it is a permissions issue, but everything seems OK. -Darrel
Other interesting topics
No two-way databinding
How solve this IF Then problem? javascript datagrid events inside item template container.dataitem cast throws exception PDF Letters if(blah) alert box else somethinge useful code continues after stop debugging How to Stop a Function? writing logs to a web page Unexplained Application restarts |
|||||||||||||||||||||||