3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
4 * Copyright (C) 2003-2008 Frederico Caldeira Knabben
8 * Licensed under the terms of any of the following licenses at your
11 * - GNU General Public License Version 2 or later (the "GPL")
12 * http://www.gnu.org/licenses/gpl.html
14 * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15 * http://www.gnu.org/licenses/lgpl.html
17 * - Mozilla Public License Version 1.1 or later (the "MPL")
18 * http://www.mozilla.org/MPL/MPL-1.1.html
22 * This is the "File Uploader" for PHP.
25 require './config.php';
28 require './commands.php';
29 require './phpcompat.php';
31 function SendError( $number, $text )
33 SendUploadResults( $number, '', '', $text ) ;
37 // Check if this uploader has been enabled.
38 if ( !$Config['Enabled'] )
39 SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ;
41 $sCommand = 'QuickUpload' ;
43 // The file type (from the QueryString, by default 'File').
44 $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
46 $sCurrentFolder = GetCurrentFolder() ;
48 // Is enabled the upload?
49 if ( ! IsAllowedCommand( $sCommand ) )
50 SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' ) ;
52 // Check if it is an allowed type.
53 if ( !IsAllowedType( $sType ) )
54 SendUploadResults( 1, '', '', 'Invalid type specified' ) ;
57 FileUpload( $sType, $sCurrentFolder, $sCommand );