Subversion Repositories Applications.papyrus

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1075 → Rev 1688

/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/lasso/upload.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/lasso/upload.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/lasso/config.lasso
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/lasso/config.lasso
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/test.html
New file
0,0 → 1,129
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: test.html
* Test page for the "File Uploaders".
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
-->
<html>
<head>
<title>FCKeditor - Uploaders Tests</title>
<script language="javascript">
 
function SendFile()
{
var sUploaderUrl = cmbUploaderUrl.value ;
if ( sUploaderUrl.length == 0 )
sUploaderUrl = txtCustomUrl.value ;
if ( sUploaderUrl.length == 0 )
{
alert( 'Please provide your custom URL or select a default one' ) ;
return ;
}
eURL.innerHTML = sUploaderUrl ;
txtUrl.value = '' ;
frmUpload.action = sUploaderUrl ;
frmUpload.submit() ;
}
 
function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
switch ( errorNumber )
{
case 0 : // No errors
txtUrl.value = fileUrl ;
alert( 'File uploaded with no errors' ) ;
break ;
case 1 : // Custom error
alert( customMsg ) ;
break ;
case 10 : // Custom warning
txtUrl.value = fileUrl ;
alert( customMsg ) ;
break ;
case 201 :
txtUrl.value = fileUrl ;
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
break ;
case 202 :
alert( 'Invalid file' ) ;
break ;
case 203 :
alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
break ;
default :
alert( 'Error on file upload. Error number: ' + errorNumber ) ;
break ;
}
}
 
</script>
</head>
<body>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" height="100%">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td nowrap>
Select the "File Uploader" to use:<br>
<select id="cmbUploaderUrl">
<option selected value="asp/upload.asp">ASP</option>
<option value="aspx/upload.aspx">ASP.Net</option>
<option value="cfm/upload.cfm">ColdFusion</option>
<option value="lasso/upload.lasso">Lasso</option>
<option value="php/upload.php">PHP</option>
<option value="">(Custom)</option>
</select>
</td>
<td nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td width="100%">
Custom Uploader URL:<BR>
<input id="txtCustomUrl" style="WIDTH: 100%; BACKGROUND-COLOR: #dcdcdc" disabled type="text">
</td>
</tr>
</table>
<br>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td noWrap>
<form id="frmUpload" target="UploadWindow" enctype="multipart/form-data" action="" method="post">
Upload a new file:<br>
<input type="file" name="NewFile"><br>
<input type="button" value="Send it to the Server" onclick="SendFile();">
</form>
</td>
<td style="WIDTH: 16px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td vAlign="top" width="100%">
Uploaded File URL:<br>
<INPUT id="txtUrl" style="WIDTH: 100%" readonly type="text">
</td>
</tr>
</table>
<br>
Post URL: <span id="eURL">&nbsp;</span>
</td>
</tr>
<tr>
<td height="100%">
<iframe name="UploadWindow" width="100%" height="100%" src="../../fckblank.html"></iframe>
</td>
</tr>
</table>
</body>
</html>
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/io.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/io.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/class_upload.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/class_upload.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/upload.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/upload.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/config.asp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/asp/config.asp
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/cfm/upload.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/cfm/upload.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/cfm/config.cfm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/cfm/config.cfm
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/php/upload.php
New file
0,0 → 1,120
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: upload.php
* This is the "File Uploader" for PHP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
require('config.php') ;
require('util.php') ;
 
// This is the function that sends the results of the uploading process.
function SendResults( $errorNumber, $fileUrl = '', $fileName = '', $customMsg = '' )
{
echo '<script type="text/javascript">' ;
echo 'window.parent.OnUploadCompleted(' . $errorNumber . ',"' . str_replace( '"', '\\"', $fileUrl ) . '","' . str_replace( '"', '\\"', $fileName ) . '", "' . str_replace( '"', '\\"', $customMsg ) . '") ;' ;
echo '</script>' ;
exit ;
}
 
// Check if this uploader has been enabled.
if ( !$Config['Enabled'] )
SendResults( '1', '', '', 'This file uploader is disabled. Please check the "editor/filemanager/upload/php/config.php" file' ) ;
 
// Check if the file has been correctly uploaded.
if ( !isset( $_FILES['NewFile'] ) || is_null( $_FILES['NewFile']['tmp_name'] ) || $_FILES['NewFile']['name'] == '' )
SendResults( '202' ) ;
 
// Get the posted file.
$oFile = $_FILES['NewFile'] ;
 
// Get the uploaded file name extension.
$sFileName = $oFile['name'] ;
 
// Replace dots in the name with underscores (only one dot can be there... security issue).
if ( $Config['ForceSingleExtension'] )
$sFileName = preg_replace( '/\\.(?![^.]*$)/', '_', $sFileName ) ;
 
$sOriginalFileName = $sFileName ;
 
// Get the extension.
$sExtension = substr( $sFileName, ( strrpos($sFileName, '.') + 1 ) ) ;
$sExtension = strtolower( $sExtension ) ;
 
// The the file type (from the QueryString, by default 'File').
$sType = isset( $_GET['Type'] ) ? $_GET['Type'] : 'File' ;
 
// Check if it is an allowed type.
if ( !in_array( $sType, array('File','Image','Flash','Media') ) )
SendResults( 1, '', '', 'Invalid type specified' ) ;
 
// Get the allowed and denied extensions arrays.
$arAllowed = $Config['AllowedExtensions'][$sType] ;
$arDenied = $Config['DeniedExtensions'][$sType] ;
 
// Check if it is an allowed extension.
if ( ( count($arAllowed) > 0 && !in_array( $sExtension, $arAllowed ) ) || ( count($arDenied) > 0 && in_array( $sExtension, $arDenied ) ) )
SendResults( '202' ) ;
 
$sErrorNumber = '0' ;
$sFileUrl = '' ;
 
// Initializes the counter used to rename the file, if another one with the same name already exists.
$iCounter = 0 ;
 
// Get the target directory.
if ( isset( $Config['UserFilesAbsolutePath'] ) && strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
$sServerDir = $Config['UserFilesAbsolutePath'] ;
else
$sServerDir = GetRootPath() . $Config["UserFilesPath"] ;
 
if ( $Config['UseFileType'] )
$sServerDir .= $sType . '/' ;
 
while ( true )
{
// Compose the file path.
$sFilePath = $sServerDir . $sFileName ;
 
// If a file with that name already exists.
if ( is_file( $sFilePath ) )
{
$iCounter++ ;
$sFileName = RemoveExtension( $sOriginalFileName ) . '(' . $iCounter . ').' . $sExtension ;
$sErrorNumber = '201' ;
}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
 
if ( is_file( $sFilePath ) )
{
$oldumask = umask(0) ;
chmod( $sFilePath, 0777 ) ;
umask( $oldumask ) ;
}
if ( $Config['UseFileType'] )
$sFileUrl = $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
else
$sFileUrl = $Config["UserFilesPath"] . $sFileName ;
 
break ;
}
}
 
SendResults( $sErrorNumber, $sFileUrl, $sFileName ) ;
?>
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/php/config.php
New file
0,0 → 1,52
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: config.php
* Configuration file for the PHP File Uploader.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
global $Config ;
 
// SECURITY: You must explicitelly enable this "uploader".
$Config['Enabled'] = false ;
 
// Set if the file type must be considere in the target path.
// Ex: /UserFiles/Image/ or /UserFiles/File/
$Config['UseFileType'] = false ;
 
// Path to uploaded files relative to the document root.
$Config['UserFilesPath'] = '/UserFiles/' ;
 
// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Usefull if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'.
// Attention: The above 'UserFilesPath' must point to the same directory.
$Config['UserFilesAbsolutePath'] = '' ;
 
// Due to security issues with Apache modules, it is reccomended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;
 
$Config['AllowedExtensions']['File'] = array() ;
$Config['DeniedExtensions']['File'] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi') ;
 
$Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
 
$Config['AllowedExtensions']['Flash'] = array('swf','fla') ;
$Config['DeniedExtensions']['Flash'] = array() ;
 
?>
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/php/util.php
New file
0,0 → 1,36
<?php
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
*
* For further information visit:
* http://www.fckeditor.net/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: util.php
* This is the File Manager Connector for ASP.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
 
function RemoveExtension( $fileName )
{
return substr( $fileName, 0, strrpos( $fileName, '.' ) ) ;
}
 
function GetRootPath()
{
$sRealPath = realpath( './' ) ;
 
$sSelfPath = $_SERVER['PHP_SELF'] ;
$sSelfPath = substr( $sSelfPath, 0, strrpos( $sSelfPath, '/' ) ) ;
 
return substr( $sRealPath, 0, strlen( $sRealPath ) - strlen( $sSelfPath ) ) ;
}
 
?>
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/aspx/upload.aspx
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/branches/livraison_aha/api/fckeditor/editor/filemanager/upload/aspx/upload.aspx
New file
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property