This is a migrated thread and some comments may be shown as answers.

json error uploading file with AsyncUpload

13 Answers 126 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Ira
Top achievements
Rank 1
Ira asked on 15 Dec 2016, 02:10 PM

I am using RadAsyncUpload as follows:

<telerik:RadAsyncUpload ID="radUpload1" runat="server" AllowedFileExtensions=".wav,mp3"
    AllowedMimeTypes="audio/wav,audio/x-wav,audio/mpeg,audio/mp3" ControlObjectsVisibility="None" MaxFileInputsCount="1" OverwriteExistingFiles="True"
    ReadOnlyFileInputs="True" Width="400px" PostbackTriggers="btnUpload" OnFileUploaded="radUpload1_FileUploaded" Localization-Select="Browse"
    OnClientFileUploadFailed="OnClientFileUploadFailed" OnClientValidationFailed="OnClientValidationFailed">
</telerik:RadAsyncUpload>

When I run my website on my development server it works file. When I copy the website to my production server with the exact save configuration and upload a file, it gets "stuck" on the upload with yellow blinking graphic and the following error in the web site console:

Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at Function.m.parseJSON (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radScriptManager1_TSM&compress=1&_TSM_CombinedScri…:3389)
    at g.callback (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radScriptManager1_TSM&compress=1&_TSM_CombinedScri…:17069)
    at XMLHttpRequest.m (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=radScriptManager1_TSM&compress=1&_TSM_CombinedScri…:17180)

 

I have run http://login.connectmevoice.com/Telerik.Web.UI.WebResource.axd and I get a blank page so I know it's registered correctly. Any idea on what the issue can be?

Thank you.

 

 

13 Answers, 1 is accepted

Sort by
0
Ira
Top achievements
Rank 1
answered on 15 Dec 2016, 02:37 PM
FYI, both servers at running Windows Server 2012 R2 IIS8
0
Peter Milchev
Telerik team
answered on 20 Dec 2016, 12:22 PM
Hello Ira,

Similar errors are encountered when not all handlers are configured correctly. Unfortunately, the provided information is insufficient for us to pinpoint the exact problem. Here are some resources that might be helpful: 
If that does not help solving the issue, would you please send us an isolated sample runnable project with just the AsyncUpload control and the web.config that reproduces the issue? Thus, we would be able to investigate further your exact scenario and help you more efficiently. 

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sune Dyrberg
Top achievements
Rank 1
answered on 21 Mar 2017, 10:19 AM

Hi Ira,

Did you ever found a solution to this problem. I get the same error when uploading larger files.

Kind Regards,

Sune

0
Peter Milchev
Telerik team
answered on 24 Mar 2017, 08:28 AM
Hello Sune,

Here is the Uploading Large Files where the necessary configurations for allowing the upload of larger files are described. 

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sune Dyrberg
Top achievements
Rank 1
answered on 05 Apr 2017, 07:31 AM

Hello Peter

The error occurs when uploading files larger then 2 MB. When I run on my development server it works fine, but in production the upload hangs with a blinking yellow graphic. And the error is the same as "Ira": 

Uncaught SyntaxError: Unexpected token < in JSON at position 0...

0
Vessy
Telerik team
answered on 10 Apr 2017, 11:40 AM
Hi Sune,

Can you, please, make sure that the following configurations are applied to the web.config of your application?
<configuration>
    <system.web>
        <httpRuntime maxRequestLength="2147483640"/>
    </system.web>
    <system.web.extensions>
        <scripting>
            <webServices>
                <jsonSerialization maxJsonLength="2147483640"/>
            </webServices>
        </scripting>
    </system.web.extensions>
</configuration>


Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sune Dyrberg
Top achievements
Rank 1
answered on 10 Apr 2017, 12:58 PM

Hi Vessy,

I have the same configuration but the error still occurs. Any other ideas what could cause the error?

Regards,

Sune

0
Vessy
Telerik team
answered on 11 Apr 2017, 11:55 AM
Hi Sune,

In order to be able to provide you any further assistance on this matter we will need to replicate the problem at our end and examine the problematic configuration leading to it. Please, follow the steps from the following blog post to prepare a runnable test project and send it to us for a further investigation:
http://www.telerik.com/blogs/isolating-a-problem-in-a-sample-project

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Don
Top achievements
Rank 1
answered on 18 Apr 2017, 05:22 PM

I have same exact issue.
Any fixes?

And I am publishing to the Windows 2012 server as well.
When I publish to the Windows 2008 server, it works well.

I am trying to migrate my apps from old server to new server which is Windows 2012.

thanks

Don

0
Vessy
Telerik team
answered on 21 Apr 2017, 02:36 PM
Hi Don,

Did you try the configuration suggested in one of my previous replies? We were never able to reproduce the problem on our side with these setting applied, so there are no other fixes we can suggest at this point. We will be glad to assist you further on this matter, but we will need to replicate the behavior at hand on our side in order to determine what is causing it. It will be great if you can send us a runnable sample where the issue occurs so we can continue the case investigation.

Regards,
Vessy
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sune Dyrberg
Top achievements
Rank 1
answered on 18 May 2017, 10:13 AM

Finally I am now able to upload files larger than 2MB. I have added DisableChunkUpload="true" to the RadAsyncUpload control.

Regards,

Sune

0
Igor
Top achievements
Rank 1
answered on 14 Apr 2021, 06:11 AM

I had the same problem.

I removed AutoAddFileInputs="false" EnablePermissionsCheck="false" and added DisableChunkUpload="true" and is solved my problem.

After that I reverted my changes: added AutoAddFileInputs="false" EnablePermissionsCheck="false" and removed DisableChunkUpload="true". There wasn't bug with Json anymore. I don't undestand why...

0
Vessy
Telerik team
answered on 16 Apr 2021, 09:41 AM

Hi Igor,

Thanks a lot for sharing your solution with the community! RadSyncUpload inherits the max allowed Json length set on application level, so this could be the reason for the avoidance of this limitation.

Regards,
Vessy
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
AsyncUpload
Asked by
Ira
Top achievements
Rank 1
Answers by
Ira
Top achievements
Rank 1
Peter Milchev
Telerik team
Sune Dyrberg
Top achievements
Rank 1
Vessy
Telerik team
Don
Top achievements
Rank 1
Igor
Top achievements
Rank 1
Share this question
or