Class('App', 'linb.Com',{
Instance:{
iniComponents:function(){
// [[code created by jsLinb UI Builder
var host=this, children=[], append=function(child)
{children.push(child.get(0))};
append((new linb.UI.SLabel)
.host(host,"slabel1")
.setLeft(40)
.setTop(44)
.setCaption("Select your file: ")
);
append((new linb.UI.ComboInput)
.host(host,"upload")
.setLeft(140)
.setTop(40)
.setWidth(140)
.setReadonly(true)
.setType("upload")
.setValue("Select a file ...")
);
append((new linb.UI.SButton)
.host(host,"sbutton3")
.setLeft(290)
.setTop(40)
.setCaption("Upload it")
.onClick("_sbutton3_onclick")
);
return children;
// ]]code created by jsLinb UI Builder
},
_sbutton3_onclick:function (profile, e, src, value) {
var file=this.upload.getUploadObj();
if(file){
linb.IAjax('../request.php',{file:file},function(rsp){
linb.alert(rsp.data.message);
},function(errMsg){
linb.alert(errMsg)
}).start();
}
}
}
});
<?php
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES
["file"]["name"]);
$id = $_POST["id"];
echo "<script>
window.name=\"{id:'".$id."',data:{message:'ok'}}\"</
script>"
?>