客户参数是不会通过的文件中删除 [英] Customer parameter are not going through for file delete

查看:153
本文介绍了客户参数是不会通过的文件中删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立直接上传图片到S3水桶和我使用细上传了点。

I have setup to directly upload image to s3 bucket and I am using fine uploader for that.

我想发送文件名作为参数(到终点),同时删除文件。

I am trying to send filename as parameter (to end point) while deleting a file.

下面给出的回调片段。

onDelete: function(id) {
    $(this).setDeleteFileParams({ filename: this.getName(id) });
}

这是工作的罚款新上传的文件,但我已经有过 initialList 文件(选件),当我试图删除它们文件名参数是不会通过。

It is working fine for newly uploaded files, but I already have files through initialList (Option) and when I try to delete them the filename param is not going through.

推荐答案

您没有正确使用jQuery包装。这是很多原因我建议避免jQuery和jQuery的包装之一,作为香草的API更加直观。你忽略了一些code,但它看起来像你实际上声明事件处理程序的回调配置对象的属性,这意味着你可以避开jQuery的包装完全。

You are not using the jQuery wrapper correctly. This is one of many reasons why I have suggested avoiding jQuery and the jQuery wrapper, as the "vanilla" API is much more intuitive. You've left out some code, but it looks like you are actually declaring your event handler as a property of the callbacks config object, which means you can avoid the jQuery wrapper entirely.

onDelete: function(id) {
    var name = this.getName(id);
    this.setDeleteFileParams({filename: name}, id);
}

但是,这code是没有必要的,因为<一href="http://docs.fineuploader.com/branch/master/endpoint_handlers/amazon-s3.html#delete-file-feature-support-optional"相对=nofollow>精细上传S3将在S3中的对象的名称为关键参数的删除请求。

这篇关于客户参数是不会通过的文件中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆