AJAX上传+ ColdFusion的 [英] AJAX Upload + Coldfusion

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

问题描述

我用下面的jQuery插件上传思路:

I'm using the following JQUERY Plug-in to upload ideas:

http://valums.com/ajax-upload/

出于某种原因,我得到了以下错误:

For some reason I'm getting the following error:

The cffile action="upload" requires forms to use enctype="multipart/form-data".

尽管插件code有它:

Even though the plug-in code has it:

var form = qq.toElement('<form method="post" enctype="multipart/form-data"></form>');

任何想法的问题可能是什么?

Any ideas what the issue could be?

推荐答案

这是因为Safari4和Chrome5不允许格式化XHR请求的方式一样正常形态为主的上传。

It happens because Safari4 and Chrome5 doesn't allow to format xhr request the same way as normal form based upload.

您将需要得到的原始数据后,并将其写入到文件中,当正常的方式 中获取文件不可用。

You will need to get the raw post data and write it to the file, when normal way of getting the file is not available.

和返回{成功:真}

或在案件{错误:错误信息,显示}错误

or in case of error {"error":"error message to display"}

有一个在ColdFusion中函数调用GetHtt prequestData这可能会有帮助, 但我不知道,因为我从来没有使用过Coldfusion的自己。

There is a function in Coldfusion called GetHttpRequestData which may help, but I'm not sure, since I never used Coldfusion myself.

<一个href="http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000482.htm">http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000482.htm

如果这将是太困难了,我打算增加一个选项发送 文件类似的方式为previous版本做了,但是这个工程 完美只在Safari5,Chrome6和最新的FF,其他的用户 浏览器都会有相同的体验为IE用户。

If this will be too difficult, I'm planning to add an option to send a file similar way as the previous versions did, but this works perfectly only in Safari5, Chrome6 and latest FF, the users of other browsers will have the same experience as the IE users.

同时,你可以使用previous版本 http://github.com/valums/ajax-upload

Meanwhile you can use the previous version http://github.com/valums/ajax-upload

这篇关于AJAX上传+ ColdFusion的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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