I'm trying to integrate an image processing function into FCKEditor (a web text editor for a CMS).
I've found the relevant file which is 9 levels down from the Server doc root. Its a class for uploading files, and I've added the image processing functions in here, and adapted the method which deals with the actual uploading so it should call these functions.
The final part of my image processing calls imagejpeg() to save the file. I want this to be saved in the default FCKEditor folder so it will show up in the thumbnail browser. This is 3 levels down from the server doc root.
I've tried using $_SERVER['document_root'] etc to set the absolute path for the image to be saved to, but that hasn't seemed to work, and I haven't been able to find which file is calling the Upload class to see if that is affecting what the relative path to the destination folder would be. So I guess I wouldn't be able to chdir() to the directory until I know that either.
Its pretty hard to debug this code when FCK uses Javascript to call php files and only seems to output xml responses.
Does the relative path to a directory change if a file is included from a higher or lower level? (I'm guessing yes)
paths
Moderator: General Moderators
- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Something like
Should give you the absolute path of whichever file it is called from. So if the path was /var/www/html/someapp/index.php it would set $abs_path to /var/www/html/someapp/ - from there tag on whatever the path is to a target directory.
Code: Select all
$abs_path = dirname(__FILE__) . DIRECTORY_SEPARATOR;- Skittlewidth
- Forum Contributor
- Posts: 389
- Joined: Wed Nov 06, 2002 9:18 am
- Location: Kent, UK