Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | // THIS IS AN EXAMPLE |
---|
4 | // you will obviously need to do more server side work than I am doing here to check and move your upload. |
---|
5 | // API is up for discussion, jump on http://dojotoolkit.org/forums |
---|
6 | |
---|
7 | // JSON.php is available in dojo svn checkout |
---|
8 | require("../../../dojo/tests/resources/JSON.php"); |
---|
9 | $json = new Services_JSON(); |
---|
10 | |
---|
11 | // fake delay |
---|
12 | sleep(3); |
---|
13 | $name = empty($_REQUEST['name'])? "default" : $_REQUEST['name']; |
---|
14 | if(is_array($_FILES)){ |
---|
15 | $ar = array( |
---|
16 | // lets just pass lots of stuff back and see what we find. |
---|
17 | // the _FILES aren't coming through in IE6 (maybe 7) |
---|
18 | 'status' => "success", |
---|
19 | 'name' => $name, |
---|
20 | 'request' => $_REQUEST, |
---|
21 | 'postvars' => $_POST, |
---|
22 | 'details' => $_FILES, |
---|
23 | // and some static subarray just to see |
---|
24 | 'foo' => array('foo'=>"bar") |
---|
25 | ); |
---|
26 | |
---|
27 | }else{ |
---|
28 | $ar = array( |
---|
29 | 'status' => "failed", |
---|
30 | 'details' => "" |
---|
31 | ); |
---|
32 | } |
---|
33 | |
---|
34 | // yeah, seems you have to wrap iframeIO stuff in textareas? |
---|
35 | $foo = $json->encode($ar); |
---|
36 | ?> |
---|
37 | <textarea><?php print $foo; ?></textarea> |
---|
Note: See
TracBrowser
for help on using the repository browser.