CFFILE选择,我需要上传没有形式提交 [英] cffile alternative, I need to upload without form submit

查看:84
本文介绍了CFFILE选择,我需要上传没有形式提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想上传一个文件使用Ajax服务器,因此表单不会提交。 CFFILE requres FileField或属性,但由于有传递给ColdFusion的任何形式的对象不起作用。我可以存储用户输入的是在JavaScript中变量的值,并通过该变量CF.我如何使用这个变量来上传我的档案?谢谢你。

So I want to upload a file to the server using ajax, so the form is not submitted. Cffile requres the filefield attribute, but as there is no form object passed to coldfusion that doesn't work. I can store the value entered by the user as a variable in javascript, and pass that variable to cf. How can I use this variable to upload my file? Thanks.

修改 提交到iframe中解决了。

EDIT Solved by submitting to iframe.

推荐答案

提交表单到一个隐藏的iframe和处理表单的上传,你通常会。

Submit the form to a hidden iframe and handle your form upload as you normally would.

这篇关于CFFILE选择,我需要上传没有形式提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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