Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
ravenworks
Hangin' Around



Joined: Sep 22, 2010
Posts: 33
Location: Arizona

PostPosted: Tue Nov 23, 2010 5:08 pm Reply with quote

Greetings to all the helpful souls that frequent this forum!

I recently was able to find a solution here and am hoping to find yet another.
I am using RN 2.0.4.01 and a new install of FCKeditor 2.6.6

Everything appears to be working well with 1 exception...

When I use the editor to upload a file it goes directly into "userfiles" instead of one of the sub-directories ("file", "flash", "image", "media")

Of course when that happens I cannot view the newly uploaded file when I select the "Browse Server" button.

I have modified the "uploadpath" in rnconfig.php to: $uploadpath = '/userfiles/';
but that did not help.

I have modified the "Configuration settings for each Resource Type" in my config.php to the following:

$Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ;
$Config['DeniedExtensions']['File'] = array() ;
$Config['FileTypesPath']['File'] = $Config['UserFilesPath'] . 'file/' ;
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
$Config['QuickUploadPath']['File'] = Config['FileTypesPath']['File'] ;
$Config['QuickUploadAbsolutePath']['File']= $Config['FileTypesAbsolutePath']['File'] ;

$Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image/' ;
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
$Config['QuickUploadPath']['Image'] = Config['FileTypesPath']['Image'] ;
$Config['QuickUploadAbsolutePath']['Image']= $Config['FileTypesAbsolutePath']['Image'] ;

$Config['AllowedExtensions']['Flash'] = array('swf','flv') ;
$Config['DeniedExtensions']['Flash'] = array() ;
$Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . 'flash/' ;
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
$Config['QuickUploadPath']['Flash'] = Config['FileTypesPath']['Flash'] ;
$Config['QuickUploadAbsolutePath']['Flash']= $Config['FileTypesAbsolutePath']['Flash'] ;

$Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
$Config['DeniedExtensions']['Media'] = array() ;
$Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . 'media/' ;
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
$Config['QuickUploadPath']['Media'] = Config['FileTypesPath']['Media'] ;
$Config['QuickUploadAbsolutePath']['Media']= $Config['FileTypesAbsolutePath']['Media'] ;


Any help and/or suggestions would be greatly appreciated.

All the best,

Noel
 
View user's profile Send private message Visit poster's website
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Tue Nov 23, 2010 5:15 pm Reply with quote

Is this the fckeditor that is included with RavenNuke? If not, I would recommend using the one that came with it because it has been modified to work with RavenNuke and the one from the fckeditor website has not.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Send e-mail Visit poster's website
ravenworks







PostPosted: Tue Nov 23, 2010 5:26 pm Reply with quote

Thanks for replying.
No it's not the fckeditor that came with RavenNuke.
For some reason I had run into problems with that version (see my previous message thread):
http://www.ravenphpscripts.net/postt19373.html

Your team had supplied me with a solution for the newer version of the editor and it is working fine with the exception noted above.

All the best,

Noel
 
hicuxunicorniobestbuildpc
The Mouse Is Extension Of Arm



Joined: Aug 13, 2009
Posts: 1123

PostPosted: Wed Nov 24, 2010 5:35 am Reply with quote

Yeah, but as nuken said fckeditor has been modified to work specially with RN but could be nice to upgrade it to the new version if we get the specific modifications.
 
View user's profile Send private message
ravenworks







PostPosted: Wed Nov 24, 2010 10:36 am Reply with quote

Agreed. The first problem I had was with the Toolbar set not being found using Linux or Windows machines (for some reason it worked using Macs). See my previous post:
http://www.ravenphpscripts.net/postt19373.html

nukem accurately pointed out what needed to be changed in order to use the new fckeditor and it was the correct solution. So... all I need now is the solution to correct the upload directory path so that uploaded files are visible when using the "Browse Server" button in the fckeditor.

I'll bet there is a solution... but it is a holiday weekend and I have to patient.

Thanks...
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Wed Nov 24, 2010 11:18 am Reply with quote

I don't have alot of familiarity with the FCKeditor, but if it were me I would try to find an unmodified copy of

FCKeditor version
2.6.4.1
Build 23187

and use a tool like winmerge to compare it with the FCKeditor included with RavenNuke; which will show you the changed files, and the differences within the files themselves. Maybe then you can figure out the changes, and apply them to your more recent version of the editor..
 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Nov 24, 2010 2:35 pm Reply with quote

Also keep in mind that replacing the version that came with RN might also accidentally remove the authentication routine that prevents unauthorised access/uploading to the file storage directories.
Not a problem if you are doing a full file comparison but thought I would mention it.
 
View user's profile Send private message Send e-mail
ravenworks







PostPosted: Wed Nov 24, 2010 5:26 pm Reply with quote

Guardian2003 - Point taken. However, when using the fckeditor to upload files it does place them in the "userfiles" directory (which contains sub-directories: file, flash, image & media). Its just that when using the "Browse Server" feature, you cannot see the contents of the "userfiles" directory. You can only see the content of the "image" sub-directory (or whatever sub-directory you are accesing).

BUT... I have discovered a temporary solution as I await the proper instructions for coding the appropriate files.

Here it is:
1. Click on the "Insert/Edit Image" icon to get the "Image Properties" window to appear.
2. Then Click on the "Link" tab.
3. Next click on the "Browse Server" button.
4. Select the folder you want to place the uploaded file by Clicking the "Resource Type" drop down menu.
5. Click the "Browse" button to find the file you wish to upload.
6. Click the "Upload" button.

The above method works in that files that are uploaded to a sub-directory become available when you click the "Browse Server" button.

This whole problem came about when the original fckeditor (that came with RavenNuke) began to fail to function. We think it may be due to an incomplete attempt to install osCommerce. I have done a fresh install of the original fckeditor (that came with RavenNuke)... but the original problem still exists. NOTE: That problem was a "never ending" progress bar during an image upload with the image never being uploaded.

With the new fckeditor and nukem's code correction (see this post http://www.ravenphpscripts.com/postt19373.html) everything is working as expected except the ability to get the uploaded image(s) to go directly into the correct sub-directory (instead of directly into the "userfiles" main directory.

Anyhow... I do appreciate the input from everybody and will keep you posted on how it turns out.
 
nuken







PostPosted: Wed Nov 24, 2010 6:39 pm Reply with quote

Have you tried changing the uploads directory by the rnconfig.php.

ex:
$uploadpath = 'Your_New_Path';
 
ravenworks







PostPosted: Wed Nov 24, 2010 8:54 pm Reply with quote

Yes, I have... but I'm not sure if it is correctly coded.
The "userfiles" directory is on the root level with rnconfig.php.
The instructions are below with the way I changed the upload path.

Is this correct?

// To override the default uploads/ folder used for storing files uploaded
// through nukeWYSIWYG via FCKeditor's filemanager.
// This should have a slash at the beginning and a slash at the end (e.g. '/files/') and is relative to the URL without subdirectories
$uploadpath = '/userfiles/';

Many thanks...
 
ravenworks







PostPosted: Wed Nov 24, 2010 10:26 pm Reply with quote

I think I found the solution!

In rnconfig.php I needed to put the complete upload path.
I had been using:
$uploadpath = '/userfiles/';

I changed it to:
$uploadpath = '/mysite.com/home/mysite/public_html/userfiles/';

and now it is uploading to correct sub-directory!

Thanks for all of your help and I hope this thread will be of some use to others.
We really enjoy RavenNuke.
We moved our site from Joomla to RavenNuke and the experience has been most rewarding.

All the best to you.
 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Fri Nov 26, 2010 11:30 am Reply with quote

ravenworks, if you ever felt inclined and had some time to spare (I know, who does), I think the folks here would be interested in your thoughts around the reasons for your switching from Joomla to RavenNuke and what you have found to be more to your liking (or objective comparison). Of course, not in this thread as it would be off-topic. It could just help others who might be questioning such a move as well as give some ideas for the RN Team as to RN's strengths and possible weaknesses to short up.

Glad you are liking RN! Me too... although I have to admit that I am quite biased having previously worked on the team for 4+ years. Wink

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
ravenworks







PostPosted: Wed Dec 01, 2010 11:49 pm Reply with quote

Just discovered that I may not have the file upload problem corrected after all!

All uploaded images are going directly into the "userfiles" directory and not into the proper sub-directory (as I thought).

Of course this presents the problem of not being able to use the FCKeditor "Browse Server" function. I've been attempting to understand the instructions in the FCKeditor config.php file (includes.fckeditor/editor/filemanager/connectors/php/) but I must be missing something.

I'll keep working on it and will post when I have it resolved (or come back begging for more help!)

Oh... I made a mistake earlier in my post... we migrated from Mambo, not Joomla.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Thu Dec 02, 2010 12:48 am Reply with quote

Can you post the contents of your connectorc/php/config.php file?

This is the stock RN file:
Code:


<?php
/*
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2009 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * Configuration file for the File Manager Connector for PHP.
 */

global $Config ;

// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
//      authenticated users can access this file or use some kind of session checking.
//$Config['Enabled'] = false;
// Get $uploadpath override and authorize (ability for unauthorized upload identified by S. Electric)
define('INSIDE_FCKCONFIG', true);
define('INCLUDE_PATH', '../../../../../../');
include_once(INCLUDE_PATH.'config.php');
@require_once(INCLUDE_PATH.'db/db.php');
if (is_admin_connector($_COOKIE['admin'])) $Config['Enabled'] = true ;
else $Config['Enabled'] = false ;

// Path to user files relative to the document root.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = str_replace('\\/', '/', $sBasePath.'/');
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, 'includes' ) );
if ($uploadpath > '') $sBasePath = $uploadpath;
else $sBasePath .= 'uploads/';
$Config['UserFilesPath'] = $sBasePath ;
//$Config['UserFilesPath'] = '/userfiles/' ;

// Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful 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 recommended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

// Perform additional checks for image files.
// If set to true, validate image size (using getimagesize).
$Config['SecureImageUploads'] = true;

// What the user can do with this connector.
$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;

// Allowed Resource Types.
$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ;

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
$Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;

// After file is uploaded, sometimes it is required to change its permissions
// so that it was possible to access it at the later time.
// If possible, it is recommended to set more restrictive permissions, like 0755.
// Set to 0 to disable this feature.
// Note: not needed on Windows-based servers.
$Config['ChmodOnUpload'] = 0777 ;

// See comments above.
// Used when creating folders that does not exist.
$Config['ChmodOnFolderCreate'] = 0777 ;

/*
   Configuration settings for each Resource Type

   - AllowedExtensions: the possible extensions that can be allowed.
      If it is empty then any file type can be uploaded.
   - DeniedExtensions: The extensions that won't be allowed.
      If it is empty then no restrictions are done here.

   For a file to be uploaded it has to fulfill both the AllowedExtensions
   and DeniedExtensions (that's it: not being denied) conditions.

   - FileTypesPath: the virtual folder relative to the document root where
      these resources will be located.
      Attention: It must start and end with a slash: '/'

   - FileTypesAbsolutePath: the physical path to the above folder. It must be
      an absolute path.
      If it's an empty string then it will be autocalculated.
      Useful if you are using a virtual directory, symbolic link or alias.
      Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
      Attention: The above 'FileTypesPath' must point to the same directory.
      Attention: It must end with a slash: '/'

    - QuickUploadPath: the virtual folder relative to the document root where
      these resources will be uploaded using the Upload tab in the resources
      dialogs.
      Attention: It must start and end with a slash: '/'

    - QuickUploadAbsolutePath: the physical path to the above folder. It must be
      an absolute path.
      If it's an empty string then it will be autocalculated.
      Useful if you are using a virtual directory, symbolic link or alias.
      Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
      Attention: The above 'QuickUploadPath' must point to the same directory.
      Attention: It must end with a slash: '/'

       NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
       "userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
       This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
       Example: if you click on "image button", select "Upload" tab and send image
       to the server, image will appear in FCKeditor correctly, but because it is placed
       directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
       The more expected behaviour would be to send images directly to "image" subfolder.
       To achieve that, simply change
         $Config['QuickUploadPath']['Image']         = $Config['UserFilesPath'] ;
         $Config['QuickUploadAbsolutePath']['Image']   = $Config['UserFilesAbsolutePath'] ;
      into:
         $Config['QuickUploadPath']['Image']         = $Config['FileTypesPath']['Image'] ;
         $Config['QuickUploadAbsolutePath']['Image']    = $Config['FileTypesAbsolutePath']['Image'] ;

*/

$Config['AllowedExtensions']['File']   = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ;
$Config['DeniedExtensions']['File']      = array() ;
$Config['FileTypesPath']['File']      = $Config['UserFilesPath'] . 'file/' ;
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
$Config['QuickUploadPath']['File']      = $Config['UserFilesPath'] . 'file/' ;
$Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Image']   = array('bmp','gif','jpeg','jpg','png') ;
$Config['DeniedExtensions']['Image']   = array() ;
$Config['FileTypesPath']['Image']      = $Config['UserFilesPath'] . 'image/' ;
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
$Config['QuickUploadPath']['Image']      = $Config['UserFilesPath'] . 'image/' ;
$Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Flash']   = array('swf','flv') ;
$Config['DeniedExtensions']['Flash']   = array() ;
$Config['FileTypesPath']['Flash']      = $Config['UserFilesPath'] . 'flash/' ;
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
$Config['QuickUploadPath']['Flash']      = $Config['UserFilesPath'] . 'flash/' ;
$Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Media']   = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
$Config['DeniedExtensions']['Media']   = array() ;
$Config['FileTypesPath']['Media']      = $Config['UserFilesPath'] . 'media/' ;
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
$Config['QuickUploadPath']['Media']      = $Config['UserFilesPath'] . 'media/' ;
$Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;

function is_admin_connector($admin) {
    static $adminSave;
    if (isset($adminSave)) return $adminSave;
    if (!is_array($admin)) {
        $admin = base64_decode($admin);
        $admin = addslashes($admin);
        $admin = explode(':', $admin);
    }
    $aid=$pwd='';
    if (isset($admin[0])) $aid = $admin[0];
    if (isset($admin[1])) $pwd = $admin[1];
    $aid = substr(addslashes($aid), 0, 25);
    if (!empty($aid) && !empty($pwd)) {
        global $prefix, $db;
        $sql = 'SELECT pwd FROM '.$prefix.'_authors WHERE aid=\''.$aid.'\'';
        $result = $db->sql_query($sql);
        $pass = $db->sql_fetchrow($result);
        if ($pass[0] == $pwd && !empty($pass[0])) {
            return $adminSave = 1;
        }
    }
    return $adminSave = 0;
}

?>


Also note the default setting in rnconfig is $uploadpath = '';

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
ravenworks







PostPosted: Thu Dec 02, 2010 5:21 pm Reply with quote

Here is what I am currently using:

Quote:
<?php
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or later (the "GPL")
* http://www.gnu.org/licenses/gpl.html
*
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
* http://www.gnu.org/licenses/lgpl.html
*
* - Mozilla Public License Version 1.1 or later (the "MPL")
* http://www.mozilla.org/MPL/MPL-1.1.html
*
* == END LICENSE ==
*
* Configuration file for the File Manager Connector for PHP.
*/

global $Config ;

// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
// authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true ;

// Path to user 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. Useful 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 recommended to leave the
// following setting enabled.
$Config['ForceSingleExtension'] = true ;

// Perform additional checks for image files.
// If set to true, validate image size (using getimagesize).
$Config['SecureImageUploads'] = true;

// What the user can do with this connector.
$Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ;

// Allowed Resource Types.
$Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ;

// For security, HTML is allowed in the first Kb of data for files having the
// following extensions only.
$Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ;

// After file is uploaded, sometimes it is required to change its permissions
// so that it was possible to access it at the later time.
// If possible, it is recommended to set more restrictive permissions, like 0755.
// Set to 0 to disable this feature.
// Note: not needed on Windows-based servers.
$Config['ChmodOnUpload'] = 0777 ;

// See comments above.
// Used when creating folders that does not exist.
$Config['ChmodOnFolderCreate'] = 0777 ;

/*
Configuration settings for each Resource Type

- AllowedExtensions: the possible extensions that can be allowed.
If it is empty then any file type can be uploaded.
- DeniedExtensions: The extensions that won't be allowed.
If it is empty then no restrictions are done here.

For a file to be uploaded it has to fulfill both the AllowedExtensions
and DeniedExtensions (that's it: not being denied) conditions.

- FileTypesPath: the virtual folder relative to the document root where
these resources will be located.
Attention: It must start and end with a slash: '/'

- FileTypesAbsolutePath: the physical path to the above folder. It must be
an absolute path.
If it's an empty string then it will be autocalculated.
Useful if you are using a virtual directory, symbolic link or alias.
Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
Attention: The above 'FileTypesPath' must point to the same directory.
Attention: It must end with a slash: '/'

- QuickUploadPath: the virtual folder relative to the document root where
these resources will be uploaded using the Upload tab in the resources
dialogs.
Attention: It must start and end with a slash: '/'

- QuickUploadAbsolutePath: the physical path to the above folder. It must be
an absolute path.
If it's an empty string then it will be autocalculated.
Useful if you are using a virtual directory, symbolic link or alias.
Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
Attention: The above 'QuickUploadPath' must point to the same directory.
Attention: It must end with a slash: '/'

NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to
"userfiles" directory to maintain backwards compatibility with older versions of FCKeditor.
This is fine, but you in some cases you will be not able to browse uploaded files using file browser.
Example: if you click on "image button", select "Upload" tab and send image
to the server, image will appear in FCKeditor correctly, but because it is placed
directly in /userfiles/ directory, you'll be not able to see it in built-in file browser.
The more expected behaviour would be to send images directly to "image" subfolder.
To achieve that, simply change
$Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Image'] = $Config['UserFilesAbsolutePath'] ;
into:
$Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'] ;
$Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'] ;

*/

$Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ;
$Config['DeniedExtensions']['File'] = array() ;
$Config['FileTypesPath']['File'] = $Config['UserFilesPath'] . 'file/' ;
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
$Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png') ;
$Config['DeniedExtensions']['Image'] = array() ;
$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image/' ;
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
$Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Flash'] = array('swf','flv') ;
$Config['DeniedExtensions']['Flash'] = array() ;
$Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . 'flash/' ;
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
$Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
$Config['DeniedExtensions']['Media'] = array() ;
$Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . 'media/' ;
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
$Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ;
$Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;

?>
 
Palbin







PostPosted: Thu Dec 02, 2010 7:39 pm Reply with quote

Use my file and set $uploadpath = ''; in rnconfig.php.
 
ravenworks







PostPosted: Thu Dec 02, 2010 10:09 pm Reply with quote

Thanks for the reply.

I used your file and when I tried to "Browse Server" in the editor I received this message:
"The server didn't reply with a proper XML data. Please check your configuration."
The window opened as usual with the "images" folder showing but there were no files present. (Obviously something is wrong).

This is the code I am using for the uploadpath in rnconfig.php:
$uploadpath = '/gcpba.org/home/gcpba/public_html/userfiles/';

Any suggestions are greatly appreciated.
 
Guardian2003







PostPosted: Fri Dec 03, 2010 11:34 am Reply with quote

ravenworks wrote:
Guardian2003 - Point taken. However, when using the fckeditor to upload files it does place them in the "userfiles" directory (which contains sub-directories: file, flash, image & media). Its just that when using the "Browse Server" feature, you cannot see the contents of the "userfiles" directory. You can only see the content of the "image" sub-directory (or whatever sub-directory you are accesing).

Do those problem directories have an index.html file in them? If so, you might want to try deleting them Smile
 
ravenworks







PostPosted: Fri Dec 03, 2010 11:58 am Reply with quote

Guardian2003 - I just double checked... no index.html files in any of the sub-directories including the "userfiles" directory.

Thanks for the suggestion.
 
ravenworks







PostPosted: Fri Dec 03, 2010 6:59 pm Reply with quote

A bit of an update...

I had originally tried installing a newer version of fckeditor when a failed attempt to install osCommerce by a third party seemed to create the original problems with the editor (at least that was the only thing that I knew had changed).

My partner dropped all of the tables from that failed install and I installed ZenCart.

So... I thought perhaps I should get back to RN basics with this editor...

I uploaded all the files and directories from a freshly unpacked RN 2.4.0.1 "fckeditor".
I also uploaded the rnconfig.php file from the same freshly unpacked RN 2.4.0.1

When I tried to "Browse Server" from the image upload icon I saw an empty image directory and received this error message:
"The server didn't reply with a proper XML data. Please check your configuration."

I have reverted back to the new fckeditor (but have the unaltered [from the fresh RN package] rnconfig.php file operational) and I am back to where I've been... uploaded files go directly into the "userfiles" directory BUT "Browse Server" shows me the contents of /userfiles/image/

Is there a way to remove the sub-directories "file", "flash", "image" & "media" and have everything just upload into the "userfiles" directory?

Maybe that's the way I should go... if it will work.

Any thoughts?
 
Palbin







PostPosted: Fri Dec 03, 2010 9:15 pm Reply with quote

Look in config.php for the following
Code:


$Config['DeniedExtensions']['File']      = array() ;
$Config['FileTypesPath']['File']      = $Config['UserFilesPath'] . 'file/' ;
$Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'file/' ;
$Config['QuickUploadPath']['File']      = $Config['UserFilesPath'] . 'file/' ;
$Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Image']   = array('bmp','gif','jpeg','jpg','png') ;
$Config['DeniedExtensions']['Image']   = array() ;
$Config['FileTypesPath']['Image']      = $Config['UserFilesPath'] . 'image/' ;
$Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'image/' ;
$Config['QuickUploadPath']['Image']      = $Config['UserFilesPath'] . 'image/' ;
$Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Flash']   = array('swf','flv') ;
$Config['DeniedExtensions']['Flash']   = array() ;
$Config['FileTypesPath']['Flash']      = $Config['UserFilesPath'] . 'flash/' ;
$Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'flash/' ;
$Config['QuickUploadPath']['Flash']      = $Config['UserFilesPath'] . 'flash/' ;
$Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ;

$Config['AllowedExtensions']['Media']   = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ;
$Config['DeniedExtensions']['Media']   = array() ;
$Config['FileTypesPath']['Media']      = $Config['UserFilesPath'] . 'media/' ;
$Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].'media/' ;
$Config['QuickUploadPath']['Media']      = $Config['UserFilesPath'] . 'media/' ;
$Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ;


Try changing these.
 
ravenworks







PostPosted: Fri Dec 03, 2010 9:45 pm Reply with quote

Palbin -

That appears to have done the trick!

When I uploaded the file it appeared in the "image" directory and not the parent directory, "userfiles". Therefore, when I select "Browse Server" is shows up correctly!

Thank you!
 
ravenworks







PostPosted: Tue Dec 21, 2010 5:41 pm Reply with quote

I'm baaaaack!

Well... I don't know what happened but here's the story:

Using RN 2.4.01 and the FCKeditor that comes with RN.
rnconfig.php is set to $uploadpath = '';
(Also using the code provided by Palbin (above) for the config.php file in /includes/fckeditor/editor/filemanager/php/)

When I go to add content in ContentPlus and click on the "Insert/Edit Link" icon in the editor, everything appears to be working as expected. I can navigate the 4 sub-directories: file; image; flash; media.

When I click on the "Upload" tab and select a file (I've been using a small .pdf), it shows me the upload progress graphic and then tells me the file was uploaded successfully. I click "OK" and then it shows me the URL of the uploaded file (ie: /userfiles/file/sample.pdf)

However... the file is not there! I double check with my FTP program and it is not there.

Any ideas, suggestions or general good vibes are most appreciated!

Thanks,

Noel
 
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Tue Dec 21, 2010 5:55 pm Reply with quote

I'd start by checking the permissions on the upload directory.
I used the default /uploads/ directory myself. (bad security I know...)

It might be something in the switching is incomplete? I'd bet most people are lazy like me and don't change from default. The environment check from the installer should have provided a list of permissions and if they are ok.

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
ravenworks







PostPosted: Tue Dec 21, 2010 6:22 pm Reply with quote

Thanks for the fast reply!

I've checked all the permissions for /userfiles/ as well as the sub-directories.
They are all set for 777.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©