"System.ArgumentException: Illegal characters in path" Exception!

0 Answers 583 Views
Ajax AjaxPanel
Top achievements
Rank 1
Akshat asked on 30 May 2023, 02:29 PM


I'm getting the following exception multiple time throughout the application in error log. It's very difficult to identify the exact reason for exception occurrence as the application is vast to debug in depth. Also, I'm using Telerik Control as well as Telerik Reporting in multiple place in the application. The version of Telerik.Web.UI which I am currently using is 2023.1.323.45




System.ArgumentException: Illegal characters in path.     at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)     at System.IO.Path.GetExtension(String path)     at Telerik.Web.UI.AsyncUploadHandler.ProcessUploadedFile()     at Telerik.Web.UI.HandlerRouter.ProcessHandler(String handlerKey, HttpContext context)     at Telerik.Web.UI.WebResource.ProcessRequest(HttpContext context)     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Can anyone please provide all the possible reason behind this exception along with its step to resolve. Any help will be highly appreciated!


I have already visited multiple forum in which it is mentioned that this issue occurs in the previous version of the Telerik.Web.UI. Please confirm whether the exception mentioned above still exist in the version of Telerik.Web.UI which I am currently using i.e. 2023.1.323.45. And If not then please provide the possible reason that we need to verify on our end.

Telerik team
commented on 02 Jun 2023, 03:08 AM

The exception message you provided suggests that there is an issue with illegal characters in the path of the web resource being accessed. Specifically, the exception occurs in the Telerik.Web.UI.AsyncUploadHandler.ProcessUploadedFile() method, which is responsible for processing uploaded files.

This exception is commonly encountered when there are special or invalid characters in the file path and name. These characters are usually some kind of special symbols, which are not supported by the server. Probably the users uploading files are using unix-based operation systems, where these symbols are supported.

You could check if the file name doesn't have unsupported characters, through javascript in the OnClientFileSelected client-event of the AsyncUpload, which occurs when a file is selected in a file input control.

Another possible scenario is if you rename the files when they are uploaded and you put some invalid charters in their names.

No answers yet. Maybe you can help?

Ajax AjaxPanel
Asked by
Top achievements
Rank 1
Share this question