in file upload control getting error

1 Answer 39 Views
AsyncUpload
vikas
Top achievements
Rank 1
vikas asked on 25 Aug 2023, 01:21 PM

when uploading file 

Uncaught SyntaxError: Unexpected token '<', "


<!DOCTYPE "... is not valid JSON
    at JSON.parse (<anonymous>)
    at n.parseJSON (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a669ca791-a838-4419-82bc-9fa647338708%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2023.2.714.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a1bc89511-db65-4edd-9b7b-852f5fbc5915%3a16e4e7cd%3af7645509%3a24ee1bba%3a33715776%3a52af31a4%3a5fa37e7e%3bAjaxControlToolkit%2c+Version%3d1.0.10606.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a0b6af642-f113-415c-b33c-97e8c63eeb23%3ab14bb7d5%3acecc93f9%3adc2d6e36%3a5acd2e8e%3a13f47f54%3a4cda6429%3a35ff259d%3aefde3e73%3aca84c49e:1587:16647)
    at g.callback (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a669ca791-a838-4419-82bc-9fa647338708%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2023.2.714.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a1bc89511-db65-4edd-9b7b-852f5fbc5915%3a16e4e7cd%3af7645509%3a24ee1bba%3a33715776%3a52af31a4%3a5fa37e7e%3bAjaxControlToolkit%2c+Version%3d1.0.10606.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a0b6af642-f113-415c-b33c-97e8c63eeb23%3ab14bb7d5%3acecc93f9%3adc2d6e36%3a5acd2e8e%3a13f47f54%3a4cda6429%3a35ff259d%3aefde3e73%3aca84c49e:2838:15)
    at XMLHttpRequest.m (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a669ca791-a838-4419-82bc-9fa647338708%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2023.2.714.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a1bc89511-db65-4edd-9b7b-852f5fbc5915%3a16e4e7cd%3af7645509%3a24ee1bba%3a33715776%3a52af31a4%3a5fa37e7e%3bAjaxControlToolkit%2c+Version%3d1.0.10606.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a0b6af642-f113-415c-b33c-97e8c63eeb23%3ab14bb7d5%3acecc93f9%3adc2d6e36%3a5acd2e8e%3a13f47f54%3a4cda6429%3a35ff259d%3aefde3e73%3aca84c49e:2950:77)

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 30 Aug 2023, 10:05 AM

Hello Vikas,

The exception you have reported appears because the AsyncUpload control expects a JSON response, but instead, it receives HTML. 

That could mean that there is a problem with the configuration, and so, when the AsyncUpload sends the request to the server, an exception is returned such as (Server Error 500, Server Error 400, etc) in HTML format.

You can check out the most commonly known issues in the AsyncUpload - Common Issues article to see if there is anything that was missed from the configuration.

In the recent past, security concerns have been increasing, therefore, I highly recommend checking out the security articles and ensuring that you take all the necessary actions to secure your application.

If my suggestions do not help resolve the issue, please share more details, such as Telerik entries from the web.config, Markup + C#/VB code used to create and configure the AsyncUpload, and a Fiddler Jam capture about the issue. You can find instructions about the Fiddler Jam capture in the Capture network logs & log issues with Fiddler Jam in ASP.NET Web Forms article.

Regards,
Attila Antal
Progress Telerik

Heads up! Telerik UI for ASP.NET AJAX versions for .NET 3.5 and 4.0 are retired. Progress will continue shipping assemblies compatible with .NET 4.5 and later. See whether this affects your apps in this article.
Tags
AsyncUpload
Asked by
vikas
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or