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

Error! Upload failed. Unexpected server response - see console.

3 Answers 588 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rajesh Ramanathan
Top achievements
Rank 1
Rajesh Ramanathan asked on 12 May 2011, 06:09 AM
Following error come when i upload file

"Error! Upload failed. Unexpected server response - see console."

CODE:

[HttpPost]
        public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments)
        {
            if (attachments != null)
            {

                foreach (var uploadedFile in attachments)
                {
                    var fileName = Path.GetFileName(uploadedFile.FileName);
                }


            }

            // Return empty response so signify success
            return Content("");
        }

3 Answers, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 12 May 2011, 06:24 AM
Hello Rajesh,

The detailed message in the console should give you a better idea of what's going on. Please follow the instructions for extracting the message - Troubleshooting - Console

I'm deleting the duplicate forum thread for this issue.

Best Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rajesh Ramanathan
Top achievements
Rank 1
answered on 12 May 2011, 07:04 AM
Thanks for your reply.....

I am facing one new issue.
My page is having content coming from another view using ajax. means I am having page, on click i am calling ajax and it return me Html from another view (having telerik upload). then telerik upload not working

It show following error (javascript error in console)
jQuery("#attachments").tUpload is not a function


because this it not calling Action in controller.
0
T. Tsonev
Telerik team
answered on 13 May 2011, 08:50 AM
Hi Rajesh,

You need to register the Upload scripts by hand when it is loaded with Ajax. This is true for all Telerik MVC Extensions because the ScriptRegistrar has no way of knowing which extensions will be loaded.

Please see this help topic for detailed instructions - Using with partial views loaded via Ajax

Best Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
Rajesh Ramanathan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Rajesh Ramanathan
Top achievements
Rank 1
Share this question
or