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

kendo can not upload image and video

2 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bin
Top achievements
Rank 1
bin asked on 16 Jan 2013, 07:08 AM
Hello,

why my kendo can not upload image and video.the source like this:

$(function () {
                function openVideoUploader(requestId, callback) {
                    var origHtml = $("#uploadWin").html();
                    var updateResult = false;

                    $("#footage").kendoUpload({
                        multiple:false,
                        async:{
                            saveUrl:"/api/" + kupBucket + "/uploadvideofootage",
                            autoUpload:false
                        },
                        error:function (e) {
                            //popupAlert(e.XMLHttpRequest.response);
                            alert(e.XMLHttpRequest.responseText);
                        },
                        success:function (e) {
//                            $("#uploadForm").find(".k-progress").css("visibility", "hidden");
                            $("#uploadForm").find(".k-filename").css("height", "20px");
                        },
                        upload:function (e) {
                            e.data = { requestId: requestId };
                        },
                    });

                    var kendoWindow = $("#uploadWin").kendoWindow({
                    actions: ["Close"],
                    form: true,
                    modal:true,
                    visible: false,
                   resizable: false,
                        width:350,
                    }).data("kendoWindow").center().open();
                    
                    
                    $("#uploadWin").parent().find(".k-window-action").css("visibility", "hidden");

                    function onClosed() {
                        callback(updateResult);
                        $("#uploadWin").html(origHtml);
                        updateResult = false;
                    }

                    $("#cancelUpWin").click(function (e) {
                        updateResult = false;
                        $("#uploadWin").data("kendoWindow").close();
                    });

                }

                var uploadFootage = function (e) {
                    e.preventDefault();
                    var dataItem = this.dataItem($(e.currentTarget).closest("tr"));

                    openVideoUploader(dataItem.id, function (choice) {
                    });

                }

                var grid = $("#reqGrid").kendoGrid({
                    dataSource:{
                        transport:{
                            read:function (options) {
                                getUploadRequests("", "Open", onSuccessGetUploadRequests, null);
                                function onSuccessGetUploadRequests(responseData) {
                                    if (responseData.result == "ok" && responseData["upload-requests"] != null)
                                        options.success(responseData["upload-requests"]);
                                    else {
                                        throwServerError(responseData.reason);
                                        options.success([]);
                                    }
                                }
                            }
                        },
                        pageSize:15
                    },
                    pageable:{
                        input:true,
                        numeric:false,
                        pageSizes:false
                    },
                    sortable:true,
                    filterable:false,
                    selectable:true,
                    resizable:true,
                    columns:[
                        { field:"submittedOn", title:"&{'submited-on'}" },
                        { field:"device", title:"&{'device-name'}", template:'#= device.name #' },
                        { field:"timeFrom", title:"&{'from'}", template:'#= kendo.toString(kendo.parseDate(timeFrom, "ddMMyyyyHHmmss"), "dd/MM/yyyy hh:mm:ss")#' },
                        { field:"timeTo", title:"&{'to'}", template:'#= kendo.toString(kendo.parseDate(timeTo, "ddMMyyyyHHmmss"), "dd/MM/yyyy hh:mm:ss")#' },
                        { field:"channelId", title:"&{'channel'}" },
                        { field:"status", title:"&{'status'}" },
                        { command:[
                            { text:"&{'upload-video'}", click:uploadFootage}
                        ], title:"", width:"200px"  }
                    ]
                }).data("kendoGrid");
            }
    );

2 Answers, 1 is accepted

Sort by
0
bin
Top achievements
Rank 1
answered on 16 Jan 2013, 07:09 AM
upload .txt file no problem,but can not upload image and video,other have no error.
0
Daniel
Telerik team
answered on 17 Jan 2013, 09:12 PM
Hello,

Since text files are uploaded correctly, the problem could be caused by the file size. If your are using MVC you can increase the maximum size as described in this documentation topic.

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
bin
Top achievements
Rank 1
Answers by
bin
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or