error,upload failed,unexpected server response

3 posts, 1 answers
  1. Yuan
    Yuan avatar
    9 posts
    Member since:
    Feb 2012

    Posted 17 Feb 2012 Link to this post

    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. Yuan
    Yuan avatar
    9 posts
    Member since:
    Feb 2012

    Posted 17 Feb 2012 Link to this post

    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
  3. Answer
    T. Tsonev
    Admin
    T. Tsonev avatar
    2831 posts

    Posted 20 Feb 2012 Link to this post

    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!
Back to Top