I have implemented the latest version of FineUploader and it renders perfectly on my page.
$(document).ready(function () {
$('#jquery-wrapped-fine-uploader').fineUploader({
request: {
endpoint: 'fu/fineuploader.cfm'
}
}).on('error', function(event, id, name, reason) {
alert('error');
})
.on('complete', function(event, id, name, responseJSON){
alert('complete');
});
});
I then select a file and it contacts contacts the Coldfusion page successfully. If I look in the debugger tools / console, I can see the Coldfusion page's response. If I CFDUMP the FORM data, I see the file being passed as well. So everything works up to now.
However, once the Coldfusion page is done, the calling page fires the 'error' function and alerts 'error'.
If I look in the debugger / console, there are no errors. So I can't understand why the control is still returning an error. I suspect the error might be what I am returning from the cfm page, which is currently (this is all that is written in the cfm page at the moment):
<cfoutput>#serializeJSON( 'true' )#</cfoutput>
Does anyone see anything wrong here? I really don't know where to look to try and resolve this as there are no errors.
I am using CF10, FineUploader 3.3, Chrome
Thanks in advance.
UPDATE / ADDENDUM TO ACCEPTED ANSWER:
Basically, not only does the response have to be JSON formatted correctly, but it must have the name/value pair of “success”:”true” .
So, before, the JSON I was returning was this, which is valid JSON, but failed:
{"name":"Peter"}
However, it only started working properly after the addition of the “success”:”true” name/pair:
{"success":"true","name":"Peter"}