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

error,upload failed,unexpected server response

2 Answers 365 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Yuan
Top achievements
Rank 1
Yuan asked on 17 Feb 2012, 09:05 AM
hi,I just write like the example, my servlet have receive the upload file and wirte to the disk successfuly.but after i upload the file,it says unexpected server response.here is my script and html code:
<script type="text/javascript">
function onSuccess(e) {
var window = $("#message").data("kendoWindow");
window.center();
window.open();
window.content(e.response);
}
$(document).ready(function() {
$("#message").kendoWindow({
visible : false,
width : "400px",
height : "200px",
draggable : false
});
$("#headImg").kendoUpload({
multiple : false,
async : {
saveUrl:"${pageContext.request.contextPath}/doUpLoadHeadImg",
saveField:"headImg",
success : onSuccess
}
});
});
</script>
<input type="file" id="headImg" name="headImg" />

2 Answers, 1 is accepted

Sort by
0
Yuan
Top achievements
Rank 1
answered on 17 Feb 2012, 10:31 AM
hi,I saw the php demo,though i don't understand php,but i guess the server process should add status and the status's value,then the error is gone.However,the success event just doesn't work
0
Accepted
T. Tsonev
Telerik team
answered on 20 Feb 2012, 05:30 PM
Hello,

Please move the success option outside of async:
async: {
},
success: onSuccess


I hope this helps.

Kind regards,
Tsvetomir Tsonev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Upload
Asked by
Yuan
Top achievements
Rank 1
Answers by
Yuan
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or