【问题标题】:how to delete uploaded file from krajee fileupload plugin如何从 krajee fileupload 插件中删除上传的文件
【发布时间】:2017-03-23 10:35:09
【问题描述】:

上传有效,删除无效,网址正确。 单击删除按钮新上传的文件时未触发删除方法 我的js代码是:

$("#input-700").fileinput({
            uploadUrl: "/Account/UploadFiles", // server upload action
            uploadAsync: false,
            maxFileSize: 1000,
            maxFileCount: 5,
            uploadExtraData: function () {
                return {
                    company_mst_pk: '1',
                    user_mst_pk:'1'
                };
            },
            fileType: "any",
            overwriteInitial: false,
            initialPreviewAsData: true,
            initialPreview: [
            "http://localhost:49589/Uploads/_1ddChrysanthemum.jpg",
            "http://localhost:49589/Uploads/_1ddLighthouse.jpg",
            "http://localhost:49589/Uploads/1dd_Penguins.jpg",
            ],
            initialPreviewConfig: [
            { caption: "transport-1.jpg", size: 329892, width: "120px", url: "/Account/DeleteCV", key: 1 },
            { caption: "transport-2.jpg", size: 872378, width: "120px", url: "/Account/DeleteCV", key: 2 },
            { caption: "transport-3.jpg", size: 632762, width: "120px", url: "/Account/DeleteCV", key: 3 },
            ],
            deleteUrl: "/Account/DeleteCV",
            deleteExtraData: function () {
                return {
                    company_mst_pk: '1',
                    user_mst_pk: '1'
                };
            },
        });

【问题讨论】:

    标签: javascript c# jquery .net asp.net-mvc


    【解决方案1】:

    当你上传你的文件时,你必须像这样在 json 中回答

    {"initialPreview":["https://placeimg.com/800/460/animals/1"],"initialPreviewAsData":true,"initialPreviewConfig":[{"caption":"Animal-1.jpg","size":732762,"width":"120px","url":"/site/file-delete","key":1}]}
    

    还有更多信息http://plugins.krajee.com/file-input-ajax-demo/6

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-03
      • 2015-05-01
      • 2013-06-27
      • 1970-01-01
      • 2013-11-01
      • 2013-08-17
      相关资源
      最近更新 更多