Uploadify: onComplete not firing in Chrome and IE
I seem to be having with uploadify and the onComplete callback in both Chrome and IE. Basically, only in Firefox does the onComplete event fire.
The code works by uploading an image to the server, at which point the server returns the filename of the image. At this point onComplete should fire.
The JS can be found here: http://pastebin.com/raw.php?i=yEkEWP53 (for some reason the stackoverflow parser doesnt like the code when pasted in)
The server side code looks as follows:
function addphotosajax() {
$config['upload_path'] = './tmp/';
$config['allowed_types'] = 开发者_Python百科'gif|jpg|png';
$config['overwrite'] = false;
$this->load->library('upload', $config);
if (!$this->upload->do_upload()){
echo 0;
//echo $this->upload->display_errors();
exit;
}
$picdata = $this->upload->data();
$picloc = $picdata['file_name'];
//log_message('error',serialize($picdata));
//echo str_repeat("test", 500);
echo $picloc;
}
The other functions, such as onInit, always fire in all browsers. Also, the server always returns a valid response.
Thanks in advance
On a Mac, with the default configuration of Uploadify you require the echo "1"; at the end of upload.php or you don't get an onComplete.
精彩评论