English 中文(简体)
2. 冷聚式焦炭 j立案卷
原标题:coldfusion ajax jquery file-upload not working

我的情况就是这样。 我有一个照片管理页,其中包括1个光上载模板,2个照片详细模板,3个照相模板,4个照相模板,1个照相片,5个是动态碎条。 最初,安装了光上载模板,作为提交给自己的一种形式,它使用纸面文件上载新照片。 在我尝试增加舱位回击,以更新有关细节、特有照片和成功上载的包裹集装箱之前,这很好地发挥了作用,但我发现,在提交表格后,照相上载,我对表格附加的任何其它功能都是由纽顿的。

因此,我决定将提交纽伦改为“丁顿”,并利用jquery .ajax()上载档案,因此,我可以就成功提出我的反馈意见。 我迄今采用的麻省办法守则是:

$.ajax({
            url:  Administration/PhotoManagement/uploadPhotos.cfm ,
            type:  POST ,           
            data: { Add:  add ,
                NewFilename: file_name,
                shortName: short_name,
                description: description
            },
            contentType:  multipart/form-data ,
            success: function(response, status, xhr){
                    $( #upload ).html(response);
                    // refresh gallery, featured pic, details
                    alert( success );
                }
            },
            error: function(xhr, status){
                alert(status +     + xhr.statusText);
            }           
        });

On submit, I get 500 internal server error. Firebug console reports that the data got posted correctly, but the image doesn t get uploaded and I don t get an error message from the try/catch error code that I have around the cffile.

我不与这两种做法结婚,如果我能回去工作,我会被罚款,回到原来的做法。 任何建议? 如果你认为我应该坚持“雅克斯”做法,你会建议我设法纠正我的错误?

Edit:在上面的法典中,我添加了类型:多部分/格式数据,因为我从左侧的试捕/渔获块中发现了错误:

Invalid content type: application/x-www-form-urlencoded; charset=UTF-8

最佳回答

I m a little late to the party, but I ve used this before as an AJAX fileuploader using coldfusion:

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

When you download the package there is an example using coldfusion.

在javascript案卷中,有一项功能是使用“Complete”(qq.FileUploaderBasic)。 在这种回击方法中,你自称的背后功能就是这样:

onComplete: function(id, fileName, responseJSON)
    {
        uploaderCallBackFunction(id, fileName, responseJSON);
    },

<代码>uploaderCallBackFunction为功能I写道。 如果你也愿意的话,你可以将JSON从氟氯化碳转至备用功能。

问题回答

暂无回答




相关问题
JQuery AJAX .load - flash chart doesnt load in IE

An IE issue has me completely stumped. I have a coldfusion page that uses JQuery s AJAX .load function to load in a new flash file that is generated by coldFusion s cfchart tag. This works completely ...

Best Coldfusion Library for OpenID [closed]

I am getting ready to start a project that requires using OpenID within Coldfusion 8. I have found a number of different options and was wondering what has worked the best, get s the most support, ...

Find ColdFusion Generated ID

Is there a way to find the elements generated by ColdFusion s <CFLayout> and <CFLayoutArea> tags? These tags: <cflayout type="tab" name="MyAccount"> <cflayoutarea name="...

ColdFusion COM error

I am upgrading from CF4.5 to CF8. Calls to COM dll s that used to work in version 4.5 now throw a "Complex object types cannot be converted to simple values.." error. The COM object has a few arrays ...

What s the best way to write engine-specific CFML code?

Sometimes it is necessary to write different code for Adobe ColdFusion vs Railo vs OpenBD, due to differences in implementation. Do people have a specific method that they use for this? For example, ...

热门标签