File Upload not generating any Callback response

Environment:

Apache webserver running locally for development purposes on a Ubuntu Linuxmint 17 workstation with Firefox. Menu item generates a jQueryUI dialog with contents being a Webix UI File Uploader component.

Code for File Uploader component as follows:

var urlstr = "/includes/upload.php";
var uploader = webix.ui({
	container:"popup", width: 400, align: 'center', minHeight: 150, borderless: true,
	view: "form", name: "uploadform", id: "uploadform", rows: [
		{ view: "uploader", name:"ufiles", id: "ufiles", value: "Select File", multiple: false, autosend: false, upload: urlstr },
		{ view:"button", label: "Send file", id: 'submitbutton', click: function(e) {
			$$("ufiles").send(function(response) { //sending files
				
				$$("ufiles").onreadystatechange = function () {
					if (this.readyState == 4 && this.status == 200) {
						var response = this.responseText;
						alert('done, use firebug to see response');
					}
				}								
				var file_id = $$("ufiles").files.getFirstId(); //getting the ID
				var fileobj = $$("ufiles").files.getItem(file_id).file; //getting file object
				filename - fileobj.name;
				console.log(filename);
				alert(response.status)
			})
		}}
	]					
});

You will see various additional snippets of code in inside the fileuploader, to demonstrate the lengths that I have gone to in the last 8 hours, in order to find a solution to my problem.

I could write my own low level XHR file upload component (and have) but this defeats the object of using Webix and in any event, I cannot invoke my XHR component from the Submit Button click or by any other means from within or attached to the File Uploader component.

I have scoured your documentation at length for advice and a solution (especially the Doc. on Manipulation of Files).

The file will upload without problem but I cannot obtain ANY response from the “send” function. That is, contrary to your documentation, the “response” contains nothing or there is no action of any sort invoked as a Callback to the Send activity. This is despite the fact that Firebug response from the POST activity produces any form of valid result I choose using my PHP Upload handler or using your upload.php - string, filename, error, JSON etc.

I am also not able to attach any event to the Upload.

I am fully aware of how sensitive the XhtmlRequest can be and for me in this environment I venture to suggest it is not working.


An extended point about my environment. My overall Webix environment of which my File Uploader is one small component is the administration system for my CMS system called Cliqon Lite. The administration system operates within an iFrame which is invoked as part of a TinyBox2 window. This means that if the FileUploader component is using an iFrame, there could be some confusion as to which Document represents the Parent of that iFrame. This would account for the problem that I am suffering. You would need to be more precise in your Code and look for the The Immediate Parent as opposed to A Parent.

http://docs.webix.com/desktop__uploader_serverside.html#tuningserversideresponse

To be correctly recognized response must be a valid json and must have status=“server” property. In addition to it - response can have any extra data.

If response miss status=“server” it will be processed as failed update. It will not call callback but can be catched through onFileUploadError event.

Check
http://docs.webix.com/samples/21_upload/03_manual_send.html

Same sample can be found in the Webix’s package. The code doesn’t use parameter of callback there, but if you set breakpoint - it can be confirmed that result object is correctly provided.

in 2017 i am facing the same problem! I searched a lot but could’t fix it
this is my server code :
‘<?php
if(isset($_FILES[‘files’])){
$errors= array();
$file_name = $_FILES[‘files’][‘name’];
$file_size =$_FILES[‘files’][‘size’];
$file_tmp =$_FILES[‘files’][‘tmp_name’];
$file_type=$_FILES[‘files’][‘type’];
$file_ext=strtolower(end(explode(’.’,$_FILES[‘companyImage’][‘name’])));

  $expensions= array("jpeg","jpg","png");
  
  if(move_uploaded_file($file_tmp,"images/company/".$file_name) === true){
	 echo '{ "status": "server" }';
	  
  }else{
     echo "{ 'status': 'error'}";
  }

}
?>’
in frontend i can get an error status, but i can’t get the server status even thought the file is successfully uploaded !!!
can somebody fix it for me!!!