0

asp.net 3.5 AjaxFileUpload Could not find a part of the path:

'C:\Users\xxxx\AppData\Local\Temp_AjaxFileUpload\8F1933D0-9C0B-8D40-C342-CAD6C4833F58

An exception of type 'System.IO.DirectoryNotFoundException' occurred in mscorlib.dll but was not handled in user code

I have 2 problems:

1) this only happen sometime. 99% of the time this works fine with small and large files but sometime I get this exception. Any idea why?

2) this generate a Yellow Screen because, has it says "was not handled in user code" , which is caught by the application and a proper message is displayed, but How can I catch this exception in the page code behind, there does not seams to be a or error server side event. there is a client side event but no server side and by this time is is too late. I have a try catch in OnUploadComplete but it does not catch anything

Lambda
  • 1,020
  • 2
  • 10
  • 25

1 Answers1

0

Put this in your web.config below the system.web closing Tag:

<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
  <add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" preCondition="integratedMode"/>
</handlers>
<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2097151"/>
  </requestFiltering>
</security>

Beta-Logics
  • 324
  • 1
  • 3
  • 11