开发者

AJAX Upload + Coldfusion

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".

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?


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.

and return {"success":true}

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

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

http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000482.htm


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.

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


Did you intentionally leave out the action tag? Perhaps you can show the CFM handling the file upload as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜