/pigeoncms/Plugins/fckeditor/editor/filemanager/connectors/php/upload.php

http://pigeoncms.googlecode.com/ · PHP · 59 lines · 21 code · 12 blank · 26 comment · 3 complexity · 44e6a8a19fa895c409e7298972a0668f MD5 · raw file

  1. <?php
  2. /*
  3. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  4. * Copyright (C) 2003-2009 Frederico Caldeira Knabben
  5. *
  6. * == BEGIN LICENSE ==
  7. *
  8. * Licensed under the terms of any of the following licenses at your
  9. * choice:
  10. *
  11. * - GNU General Public License Version 2 or later (the "GPL")
  12. * http://www.gnu.org/licenses/gpl.html
  13. *
  14. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  15. * http://www.gnu.org/licenses/lgpl.html
  16. *
  17. * - Mozilla Public License Version 1.1 or later (the "MPL")
  18. * http://www.mozilla.org/MPL/MPL-1.1.html
  19. *
  20. * == END LICENSE ==
  21. *
  22. * This is the "File Uploader" for PHP.
  23. */
  24. require('./config.php') ;
  25. require('./util.php') ;
  26. require('./io.php') ;
  27. require('./commands.php') ;
  28. require('./phpcompat.php') ;
  29. function SendError( $number, $text )
  30. {
  31. SendUploadResults( $number, '', '', $text ) ;
  32. }
  33. // Check if this uploader has been enabled.
  34. if ( !$Config['Enabled'] )
  35. SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ;
  36. $sCommand = 'QuickUpload' ;
  37. // The file type (from the QueryString, by default 'File').
  38. $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
  39. $sCurrentFolder = "/" ;
  40. // Is enabled the upload?
  41. if ( ! IsAllowedCommand( $sCommand ) )
  42. SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' ) ;
  43. // Check if it is an allowed type.
  44. if ( !IsAllowedType( $sType ) )
  45. SendUploadResults( 1, '', '', 'Invalid type specified' ) ;
  46. FileUpload( $sType, $sCurrentFolder, $sCommand )
  47. ?>