How to upload path specify in kendo ui uploader

1 posts, 0 answers
  1. Pinaki
    Pinaki avatar
    3 posts
    Member since:
    Aug 2012

    Posted 07 Nov 2012 Link to this post


    I am trying to upload file to my application in download folder. But it doesn't show complete.
    It show me to retry in Image but show alert message for error and also for complete. How Could i do that . I given my code below.  

    <div style="width:45%">
        @(Html.Kendo().Upload()
            .Name("files")
            .Async(a => a
                .Save("Save", "Upload")
                .Remove("Remove", "Upload")
                        .SaveUrl("~/download/")
                .AutoUpload(true)
            )
            .Events(events => events
                .Cancel("onCancel")
                .Complete("onComplete")
                .Error("onError")
                .Progress("onProgress")
                .Remove("onRemove")
                .Select("onSelect")
                .Success("onSuccess")
                .Upload("onUpload")
            )
        )
    </div>
    <script>
        function onSelect(e) {
            alert("Select :: " + getFileInfo(e));
        }

        function onUpload(e) {
            alert("Upload :: " + getFileInfo(e));
        }

        function onSuccess(e) {
            alert("Success (" + e.operation + ") :: " + getFileInfo(e));
        }

        function onError(e) {
            alert("Error (" + e.operation + ") :: " + getFileInfo(e));
        }

        function onComplete(e) {
            alert("Complete");
        }

        function onCancel(e) {
            alert("Cancel :: " + getFileInfo(e));
        }

        function onRemove(e) {
            alert("Remove :: " + getFileInfo(e));
        }

        function onProgress(e) {
            $("#details").val("Upload progress :: " + e.percentComplete + "% :: " + getFileInfo(e));
        }

        function getFileInfo(e) {
            return $.map(e.files, function (file) {
                var info = file.name;

                // File size is not available in all browsers
                if (file.size > 0) {
                    info += " (" + Math.ceil(file.size / 1024) + " KB)";
                }
                return info;
            }).join(", ");
        }
    </script>
Back to Top