Menu
Latest Articles
- Make Apache listen on a different port
- XAMPP fails to start Apache 2 on Windows
- Remove Powered By text from RSMonials
- Joomla Zip Archiver
- Installing XDebug on XAMPP
- Joomla .htaccess - redirect non-www to www
- Remove Powered By text from JDownloads
- Joomla Custom PayPal IPN
- Using multiple databases within Joomla Framework
- Ajax Control Toolkit AsyncFileUpload - The file attached is invalid
Login
Ajax Control Toolkit AsyncFileUpload - The file attached is invalid |
![]() |
![]() |
![]() |
| Written by Alex Balyuk |
| Tuesday, 17 August 2010 21:58 |
|
Recently I was working on conversion of a social network project from ASP.NET 3.5 to ASP.NET 4.0. Everything went pretty smoothly except for AjaxControlToolkit Asynchronous File Upload control. Basically the uploading of file did not work, on the staging server nothing happening during the file upload... but in debug mode the following error was thrown ((AjaxControlToolkit.AsyncFileUpload)(sender)).FileContent' threw an exception of type 'System.NullReferenceException' with status message "The file attached is invalid." It seemed pretty odd because the code was not modified and everything functioned on .NET 3.5. This is .NET version incompatibility with AjaxControlToolkit.
Solution for this error is pretty easy, but to find solution on your own is a time consuming nightmare. I spend at least few hours reading about .NET 3.5 and .NET 4.0 differences until figured this one out. To fix it do the following:
To summarize, your opening page element in the Web.config should look like this |
| Last Updated on Thursday, 19 August 2010 15:48 |
is Free Software released under the GNU/GPL License.





