I'm using FCKeditor in cubecart. I've upgraded to the lates version and I'm having a problem with the upload image and browse image when accessing through the "insert/edit image" icon in the editor. My default image directory is: /images/uploads/
When I used the upload image by clicking the upload tab on the "insert/edit image" icon, the image will upload to the /images/uploads/ directory. However, when I use the browse feature of the "insert/edit image" icon it doesn't display the contents of that folder, and when I upload an image in browse window it will upload to a newly created /images/uploads/image/ folder. I would like them to all go to the same place, and I'm not sure what I need to do to accomplish this.
I've followed some instructions on the cubecart forum and also in the forums here, but nothing seems to make the browse point to the proper place. Can anyone help???
When I used the upload image by clicking the upload tab on the "insert/edit image" icon, the image will upload to the /images/uploads/ directory. However, when I use the browse feature of the "insert/edit image" icon it doesn't display the contents of that folder, and when I upload an image in browse window it will upload to a newly created /images/uploads/image/ folder. I would like them to all go to the same place, and I'm not sure what I need to do to accomplish this.
I've followed some instructions on the cubecart forum and also in the forums here, but nothing seems to make the browse point to the proper place. Can anyone help???
RE: upload and browse image problem
Hello,

I'm having the same problem except I'm using ASP.NET 2.0.
I've followed the integration guide on the FCKEditor Wiki but when I upload images they go into my /UserFiles/ directory, when I click to browse server it takes me into /UserFiles/Images/ folder and I can't move up a directory.
I'm using v2.4.2 with VB.NET, developing in Visual Studio 2005. I have the FCKEditor .NET control.
I've tried setting the UserFiles directory manually as described here: http://wiki.fckeditor.net/Developer's_G ... on/ASP.Net under the heading "Changing the UserFilesPath by code" but it made no difference.
If anyone can help [us] I'd be much appreciated
Cheers,
Blackred.
RE: upload and browse image problem
(Description for PHP, but perhaps you can adopt it to other adapters/languages)
The default behavior of the filebrowser is that it will search for files in a directory named like their filetype:
file: "File"
image: "Image"
flash: "Flash"
media: "Media"
If you, like me, don't like this behavior, you can change the code so that you can specify whether to use a different folder for each filetype and what folder that should be.
Config options are:
// Set directory per file type
// Leave any setting empty to work in your 'UserFilesPath' for that filetype.
$Config['FileTypeDirectories']['File'] = "myFiles";
$Config['FileTypeDirectories']['Image'] = "";
$Config['FileTypeDirectories']['Flash'] = "exampleDir";
$Config['FileTypeDirectories']['Media'] = "";
So start by adding these below in the config file of your filebrowser ('editor/filemanager/browser/default/connectors/php/config.php').
Then change the 'io.php' ('filemanager/browser/default/connectors/php/io.php') file to let it work with the config settings:
Change the function GetUrlFromPath from:
function GetUrlFromPath( $resourceType, $folderPath )
{
if ( $resourceType == '' )
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
else
return $GLOBALS["UserFilesPath"] . strtolower( $resourceType ) . $folderPath ;
}
to:
function GetUrlFromPath( $resourceType, $folderPath )
{
global $Config ;
if ( $Config['FileTypeDirectories'][$resourceType] == '' )
return RemoveFromEnd( $GLOBALS["UserFilesPath"], '/' ) . $folderPath ;
else
return $GLOBALS["UserFilesPath"] . $Config['FileTypeDirectories'][$resourceType] . $folderPath ;
}
and change the function ServerMapFolder from:
function ServerMapFolder( $resourceType, $folderPath )
{
// Get the resource type directory.
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . strtolower( $resourceType ) . '/' ;
// Ensure that the directory exists.
CreateServerFolder( $sResourceTypePath ) ;
// Return the resource type directory combined with the required path.
return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
}
to:
function ServerMapFolder( $resourceType, $folderPath )
{
global $Config ;
// Get the resource type directory.
$sResourceTypePath = $GLOBALS["UserFilesDirectory"] . $Config['FileTypeDirectories'][$resourceType] . '/' ;
// Ensure that the directory exists.
CreateServerFolder( $sResourceTypePath ) ;
// Return the resource type directory combined with the required path.
return $sResourceTypePath . RemoveFromStart( $folderPath, '/' ) ;
}
That's all!
RE: upload and browse image problem
Thanks for copy pasting
The link to my 'HOWTO - folder per filetype for filebrowser' is http://sourceforge.net/forum/forum.php? ... _id=257179