删除文件后,上传文件输入消失

问题描述

我正在创建于2011年创建的网站,该网站将Telerik UI用于APS.NET MVC和jquery插件uploadify。我的问题是,当我从计算机上传文件然后将其删除时,负责上传文件的按钮消失了,要重复操作,我需要刷新浏览器。附件仅限于一个文件。 这来自创建部分的cshtml文件

 @(Html.Telerik().Upload()
                .Name("coreDocument")
                .Multiple(false)
                .Async(asyncx => asyncx
                    .Save("SaveCoreDocument","Document",new { documentStoragePath = Model.CoreDocument.DocumentStoragePath })
                    .Remove("RemoveCoreDocument",new { documentStoragePath = Model.CoreDocument.DocumentStoragePath })
                    .AutoUpload(true)

                ).ClientEvents(
                    ev =>
                    {
                        ev.OnUpload("onCoreUpload");
                        ev.OnSuccess("onSuccess");
                        ev.OnError("onError");
                        ev.OnRemove("onCoreRemove");
                    })

控制器看起来像这样:

public ActionResult RemoveCoreDocument(string[] fileNames,string documentStoragePath)
        {
            _fileManager.ClearDirectory(ApplicationStoragePath,documentStoragePath);
            // The parameter of the Remove action must be called "fileNames"
            //foreach (var fullName in fileNames)
            //{
            //ClearDirectory(documentStoragePath);
            //DeleteFile(Path.GetFileName(fullName),documentStoragePath);
            //}
            // Return an empty string to signify success
            //return new JsonResult { Data = new { success = true}};
            return Content("");
        }

“用于上传的HTML”部分是

<div class="t-widget t-upload">
          <div class= "t-dropzone">
          <div class="t-button t-upload-button">
          <span>Select...</span>
          <input id ="coreDocument" name="coreDocument" type="file" autocomplete="off">
          </div>
          <em> drop files here to upload</em>
          </div>
         </div>

当我在控制台中调试它时,停止在其他js文件上的onCoreRemove函数中,但是即使我在其中更改或添加了某些内容(如尝试使jquery消失的div可见),也不会对它产生很大的影响最终的效果。然后到jquery-1.5.1.min.js,然后按钮消失。后来,它从telerik.common.js和telerik.upload.js(_onFileAction)调用函数

if (icon.hasClass("t-delete")) {
                    if (!$t.trigger(this.wrapper,"remove",eventArgs)) {
                        fileEntry.trigger("t:remove");
                    }

那么,您是否知道我应该从哪里开始?也许您在这里看到了一个明显的错误,或者您是否知道某些情况是由于某些库的版本过旧造成的?我是这个项目的新手,这里没有更多高级开发人员...

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)