When using ASP .NET routing, the AjaxFileUpload control throws an exception related to not being able to find the temp directory where the control stores the uploaded file.
It seems only routes that contain Route Data are affected, but I'm not sure about this.
The exception is:
Could not find a part of the path 'C:\Users\[user]\AppData\Local\Temp\_AjaxFileUpload\[fileId]'
The issue, and its solution, is documented here:
http://stackoverflow.com/questions/19115761/ajax-fileupload-route-querystring-directorynotfoundexception
I followed the directions in the posted solution by changing line 22 of the AjaxFileUpload.Control.pre.js file as follows:
this._uploadUrl = 'AjaxFileUploadHandler.axd';
to:
this._uploadUrl = '/AjaxFileUploadHandler.axd';
I don't pretend to understand the full issue here, but it would be nice if this control worked with routing so that I didn't have to run a fork of the Toolkit dll to have this work.
Comments: I don't publish thesite yet. But is very simpler to reproduce the error: 1 . I create a web form project with .net 4.6 framework. 2. Install and configure the ajaxcontroltoolkit. 3. Put the AjaxFileUpload into Default.aspx. 4. Create the event uploadcomplete. 5. Try localhost/Default and localhost/Default/Teste
It seems only routes that contain Route Data are affected, but I'm not sure about this.
The exception is:
Could not find a part of the path 'C:\Users\[user]\AppData\Local\Temp\_AjaxFileUpload\[fileId]'
The issue, and its solution, is documented here:
http://stackoverflow.com/questions/19115761/ajax-fileupload-route-querystring-directorynotfoundexception
I followed the directions in the posted solution by changing line 22 of the AjaxFileUpload.Control.pre.js file as follows:
this._uploadUrl = 'AjaxFileUploadHandler.axd';
to:
this._uploadUrl = '/AjaxFileUploadHandler.axd';
I don't pretend to understand the full issue here, but it would be nice if this control worked with routing so that I didn't have to run a fork of the Toolkit dll to have this work.
Comments: I don't publish thesite yet. But is very simpler to reproduce the error: 1 . I create a web form project with .net 4.6 framework. 2. Install and configure the ajaxcontroltoolkit. 3. Put the AjaxFileUpload into Default.aspx. 4. Create the event uploadcomplete. 5. Try localhost/Default and localhost/Default/Teste