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:

 

http://forums.adobe.com/message/3057005



More discussions in Advanced Techniques


adobe

Comments

Popular posts from this blog

How to decompile jsxbin to jsx

Gavik Photoslide GK2: Not able to upload photos - Joomla! Forum - community, help and support

Phoca Guestbook logger registret bruger af - Joomla! Forum - community, help and support