Sigma Php Ajax framework, Ajax Components, GUI Builder
February 11, 2012, 11:59:24 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
Sigma Php Ajax framework, Ajax Components, GUI Builder
>
Sigma Visual GUI Builder & Library
>
Sigma Visual - Q&A
(Moderators:
steven
,
linb
) >
Need help with Upload (combobox) control
Pages: [
1
]
« previous
next »
Print
Author
Topic: Need help with Upload (combobox) control (Read 1133 times)
mywebwork
Jr. Member
Posts: 15
Need help with Upload (combobox) control
«
on:
October 16, 2009, 02:46:01 PM »
Hi
First let me say this is a wonderful product, I've been building a project with both the Sigma Grid and the Sigma Visual developers IDE and I really love it. Have had a bit of difficulty understanding some of it initially but now that I'm getting more proficient I really have grown to love these products and will definitely be purchasing a commercial version as soon as I can.
One thing that I haven't been able to get working correctly is using the combobox in it's "Upload" mode. What I could really use is a sample of the JavaScript and server-side PHP code.
Is there anyone who can assist me?
Thank You
Bill
Logged
linb
Administrator
Hero Member
Posts: 433
Re: Need help with Upload (combobox) control
«
Reply #1 on:
October 16, 2009, 07:13:32 PM »
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(); } } } });
«
Last Edit: October 16, 2009, 07:33:34 PM by linb
»
Logged
mywebwork
Jr. Member
Posts: 15
Re: Need help with Upload (combobox) control
«
Reply #2 on:
October 17, 2009, 07:22:37 PM »
Linb, thank you SO MUCH for your reply, this is extremely helpful!
Is there any chance that you could share some PHP code to use on the server side to store the uploaded file?
Thanks again for your response!
Bill
Logged
linb
Administrator
Hero Member
Posts: 433
Re: Need help with Upload (combobox) control
«
Reply #3 on:
October 18, 2009, 12:07:40 AM »
I haven't that php code in hand, try this(no testing yet)
<?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>" ?>
Logged
mywebwork
Jr. Member
Posts: 15
Re: Need help with Upload (combobox) control
«
Reply #4 on:
October 18, 2009, 03:01:45 AM »
Once again thank you so much! I used the PHP as a basis for my own code, it works great now!
Aloha!
Bill
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News & Announcements
-----------------------------
Sigma Visual GUI Builder & Library
-----------------------------
=> Sigma Visual - Knowledge Share
=> Sigma Visual - Q&A
=> Bug Report & Wishlist
-----------------------------
Sigma Grid
-----------------------------
=> Sigma Grid - Q&A
=> Show Case
=> Bug Report & Wishlist
-----------------------------
Other
-----------------------------
=> AJAX & JavaScript
Loading...