RE: System.Reflection.TargetInvocationException:

  • Thread starter Thread starter Sandi Rae
  • Start date Start date
S

Sandi Rae

I believe this is what you are looking for?
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. ---> System.IO.IOException: Insufficient
system resources exist to complete the requested service.

at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.FileStream.WriteCore(Byte[] buffer, Int32 offset, Int32
count)
at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32
count)
at System.Web.HttpPostedFile.SaveAs(String filename)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture)
at Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object
o, MethodBase method, ParameterInfo[] Parameters, Object[] args)
at
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Obje
ct o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object
o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack)
at upload.upload()
at upload.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()

As far as snippet of code, it's 413 lines, the actual upload line is:
file1.postedfile.saveas(strRDOValue & "\" & strFileName1)

Now, please note that this error only occurs on larger files, ones that
are close to the limit. (I have a 100MB limit on one site, and this
error occurs with a 97MB file.)

Thanks,
Rae
 
Hi Rae,

Thanks for your response. I did some research and did not find any known
issue about this problem. As indicated in the error message "Insufficient
system resources exist to complete the requested service", I susgest you to
check whether there is enough free space in harddisk to save the file.

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
 
Does anyone have an update on this issue? I am encountering the same
situation - unable to use postedfile.saveas for large files - same
stack trace - insufficient system resource, even though memory and
hard disk space are plentiful. Any followup would be appreciated.
Thanks, Drew
 
Hi Drew,

By default, the maximum file upload size supported by ASP.NET is 4 MB. We
are able to allow large files by adding the following entry in Web.config
file:

<httpRuntime maxRequestLength="4096" />

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
 
Back
Top