FCKEditor solution – How to store full URL for images (Show absolute path)
- Date: Mar 25, 2010
- Author: Rakshit Patel
- Comments: 9
- Tags: Absolute path for Image, Complete image url in fckeditor, FCKEditor problem solved, Fixed image path problem, Full url for image upload from fckeditor, Helpful tips, How to, Magic Tricks, Not storing full url of image, Problem solved, Send image in email from FCKEditor, Showing relative path for image
- Categories: Common Issues/Bugs, Helpful Tips and Tricks
Today i came across a problem with FCKEditor. When i upload an image from fckeditor Browser Server option, it uploads correctly and insert image in content as well. But if i will send this content in email (for newsletter) than image will not be there as fckeditor inserts relative path in source of image. There should be a complete URL for image if you are sending this content into email. I was trying to find the way that how to insert the full url path when image uploads from FCKEditor.
I was in urgency so i found the alternative solution to make this problem fixed(solved) right away. What i have done is , find the relative path and replace it with full URL path. Look at below line which replace the absolute path inplace of relative path in image source tag.
$msg = str_replace('src="/userfiles/','src="http://www.example.com/userfiles/',$msg);