带有Blueimp jquery文件上传插件的可选文件上传 [英] Optional File Upload with Blueimp jquery file upload plugin

查看:92
本文介绍了带有Blueimp jquery文件上传插件的可选文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该问题与来自blueimp的jquery文件上传插件

我正在构建一个表格,其中文件上传是可选的.事实证明,当没有选择要上传的文件时,我无法发布表单.正因为如此,如果用户决定不添加实际数据,我必须在页面上创建两个表单并进行所有脏检查以删除上载的文件.

I am building a form where the file uploads are optional. It turns out I cannot post form when there are no files selected for upload. Just because of this I have to create two forms on my page and do all the dirty checking to delete uploaded files if the user decides not to add actual data.

问题是:

即使没有选择任何文件,我也可以提交表单,这样我仍然可以在服务器端接收其他表单数据吗?

Can I submit the form even if no files are selected so that i can still be able to receive the additional form data on server side ?

推荐答案

我自己也遇到了同样的问题.我有一个使用蓝色imp angular实现的表单(内置于Angular中).表单本身具有字段;该文件是可选的.需要是一个帖子(带或不带文件).

I have the same issue myself. I have a form (built in Angular), using blue imp angular implementation. The form itself has fields; the file is optional. Needs to be a single post (with or without the file).

在submit()上没有任何反应.

On submit() nothing happens.

仅当添加文件时才会触发上面列出的有用事件".

The "helpful events" listed above only are fired when a file is added.

这篇关于带有Blueimp jquery文件上传插件的可选文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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