ReceiveFile.php 719 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. // THIS IS AN EXAMPLE
  3. // you will obviously need to do more server side work than I am doing here to check and move your upload.
  4. // API is up for discussion, jump on http://dojotoolkit.org/forums
  5. // JSON.php is available in dojo svn checkout
  6. require("../../../dojo/tests/resources/JSON.php");
  7. $json = new Services_JSON();
  8. // fake delay
  9. sleep(3);
  10. $name = empty($_REQUEST['name'])? "default" : $_REQUEST['name'];
  11. if(is_array($_FILES)){
  12. $ar = array(
  13. 'status' => "success",
  14. 'details' => $_FILES[$name]
  15. );
  16. }else{
  17. $ar = array(
  18. 'status' => "failed",
  19. 'details' => ""
  20. );
  21. }
  22. // yeah, seems you have to wrap iframeIO stuff in textareas?
  23. $foo = $json->encode($ar);
  24. ?>
  25. <textarea><?php print $foo; ?></textarea>