Back to index

moin  1.9.0~rc2
upload.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
00004  * Copyright (C) 2003-2009 Frederico Caldeira Knabben
00005  *
00006  * == BEGIN LICENSE ==
00007  *
00008  * Licensed under the terms of any of the following licenses at your
00009  * choice:
00010  *
00011  *  - GNU General Public License Version 2 or later (the "GPL")
00012  *    http://www.gnu.org/licenses/gpl.html
00013  *
00014  *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
00015  *    http://www.gnu.org/licenses/lgpl.html
00016  *
00017  *  - Mozilla Public License Version 1.1 or later (the "MPL")
00018  *    http://www.mozilla.org/MPL/MPL-1.1.html
00019  *
00020  * == END LICENSE ==
00021  *
00022  * This is the "File Uploader" for PHP.
00023  */
00024 
00025 require('./config.php') ;
00026 require('./util.php') ;
00027 require('./io.php') ;
00028 require('./commands.php') ;
00029 require('./phpcompat.php') ;
00030 
00031 function SendError( $number, $text )
00032 {
00033        SendUploadResults( $number, '', '', $text ) ;
00034 }
00035 
00036 
00037 // Check if this uploader has been enabled.
00038 if ( !$Config['Enabled'] )
00039        SendUploadResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/connectors/php/config.php" file' ) ;
00040 
00041 $sCommand = 'QuickUpload' ;
00042 
00043 // The file type (from the QueryString, by default 'File').
00044 $sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
00045 
00046 $sCurrentFolder      = "/" ;
00047 
00048 // Is enabled the upload?
00049 if ( ! IsAllowedCommand( $sCommand ) )
00050        SendUploadResults( '1', '', '', 'The ""' . $sCommand . '"" command isn\'t allowed' ) ;
00051 
00052 // Check if it is an allowed type.
00053 if ( !IsAllowedType( $sType ) )
00054     SendUploadResults( 1, '', '', 'Invalid type specified' ) ;
00055 
00056 
00057 FileUpload( $sType, $sCurrentFolder, $sCommand )
00058 
00059 ?>