When an image is inserted into the editor it is a virtual path "/path/image.gif".
How do I get the full path "http://domain.com/path/image.gif"?
And where do you set "FCKConfig.BasePath"?
Mon, 05/12/2008 - 00:10
#1
Re: Image path inserted into editor
Re: Image path inserted into editor
I found the solution to my problem in case anyone else needs it:
1. go to "editor/filemanager/browser/default"
2. find "frmresourceslist.html"
3. edit the line below "oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )" which should be around line 65
4. from: var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;
to: var sLink = '<a href="#" onclick="OpenFile(\'http://www.yourdomain.com' + fileUrl + '\');return false;">' ;
and it will then insert the full path to your image in the editor window.
(note: you may have to close your browser and reopen before this will take effect)
Re: Image path inserted into editor
Thanks for that, helpful - at least there wont be any more ../path/problems/
Only one thing though...
It said "ProtectPath(" wont this create a security issue? I mean what exactly does ProtectPath mean with FCKeditor?
Mine is like this and still works 100%
Too bad there isn't a way to get the URL like this: (I have tried these with no luck!)
//using my methods wont work due to the path... It has to be plain text like this "http://www.domain.com/uploads/"
Cheers
Re: Image path inserted into editor
Hello Friends

I am Priyesh Pandya writting this as I stuck on same problem I solved mysef ..
You really dont have to do all non logical stuffs
simply use a congif variable to set URL
do following thing :
1 first download latest FCK ( I am using Version 2)
2 open file root\FCKeditor\editor\filemanager\connectors\php\config.php
3 create dir in '/FCKeditor/uploadfiles/
now copy and paste code in your config.php :
----------------------------------------------------------------------------------------------------------
// Path to user files relative to the document root.
$Config['UserFilesPath'] = 'http://'.$_SERVER['HTTP_HOST'].'/FCKeditor/uploadfiles/' ;
// 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'] = $_SERVER['DOCUMENT_ROOT'].'/FCKeditor/uploadfiles/' ;
------------------------------------------------------------------------------------------------------------
How does work:
The 2 variable set here are $Config['UserFilesPath'] and $Config['UserFilesAbsolutePath'] ,
$Config['UserFilesPath'] = 'http://'.$_SERVER['HTTP_HOST'].'/FCKeditor/uploadfiles/' ; This will set the absolute URL to uploaded images ( sets from PHP Global variable SERVER , works for localhost as well as http://www.mydomain.com ... ) , here you need to create dirs " FCKeditor/uploadfiles/" , for all uploaded images .
your image src tag looks like "http://mydomian.com/FCKeditor/uploadfiles/test.jpg"
$Config['UserFilesAbsolutePath'] = $_SERVER['DOCUMENT_ROOT'].'/FCKeditor/uploadfiles/' ; this is config variable returns path to upload image dir of apache server - 'C:\xampp\htdocs\FCKeditor\uploadfiles\ and second line should be same like "/FCKeditor/uploadfiles/" used in $Config['UserFilesPath'].
Now this works fine in all FCK upload case -even in fckeditor email send
Thanks
priyesh pandya (priyesh.ak38@gmail.com)