cffileupload - JSON return causing error
i have page has cffileuload tag.
the process page moves file new location , returns json stuct.
<cfset str.status = 200>
<cfset str.message = "passed">
<cfoutput>#serializejson(str)#</cfoutput>
when run page red bar error (no number) on first file , uploading stops. actual file move being processed.
when comment out str.status = 200 seems work fine.
i don't have understanding of ajax under assumption status 200 feedback uploader page has run.
according documentation need output json above.
any appreciated.
running: cf9.0.1
i'm having same problem. examples i've found upload handler should return following json (using own appropriate values):
<cfset str.status = 200>
<cfset str.message = "this message.">
<cfoutput>#serializejson (str)#</cfoutput>
but error... progress bar turns red , when output results of oncomplete js function, get
status: [500], message: [error], file: [temp.txt]
output comes oncomplete function (oncomplete="uploadfilescomplete"):
function uploadfilescomplete (file) {
var msg = '<p>status: [' + file.status + '], message: [' + file.message + '], file: [' + file.filename + ']</p>';
var obj = document.getelementbyid ('upload-results');
if (obj)
obj.innerhtml = obj.innerhtml + msg;
}
but if don't return output, get:
status: [200], message: [success], file: [temp.txt]
i wonder if worked in cf 9.0, broken in cf 9.0.1. ran problem after updating cf 9.0.1 (ajax cflayoutarea broken) here:
More discussions in Advanced Techniques
adobe
Comments
Post a Comment