function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Vinar AmrutiaVinar Amrutia 

Get rich text picture URL

I am trying to get the URL of an image which I have uploaded on my rich text field of a custom object. Any ideas or pointers.
Anil SavaliyaAnil Savaliya
Hi Vinar,

You can't get image from rich text area.But you can retrive from attchment with related record.
Vinar AmrutiaVinar Amrutia
Thanks for the response Anil. What do you mean by you canot get image from rick text area. Can you explaim me more. I just uploaded an image in RTB, then I got the image information and Salesforce opened up a tab with this URL and the picture. This makes me conlude that SF is storing the picture somewhere with a ref id.

I am just not sure how to get this URL. If you closedly monitor the URL, the first ID is the record ID for which this image belongs i.e EID
- The FEOID is same for all the images I have uploaded and I suppose REDIF is the one which distinguishes every image. 

https://cloudapps-XXX-XXX--oscar--c.cs11.content.force.com/servlet/rtaImage?eid=01tU0000000wD6H&feoid=00NZ0000001Aloe&refid=0EMZ00000000UUb
kevin Carotherskevin Carothers
The only thing I can think of is to write a Java/.Net app that pulls the RTF field, parse it, and then send the parsed field back to SFDC in a custom field.  If you are using the software not-for-profit there's this one;    http://rtf2fo.com.  

There is also a command line processor;   http://ftp.nluug.nl/editors/ted/TedDocument-en_US.html

Also, if you want to go the java app route, you can use  the Java 6 RTFEditorKit -- the code woould look something like this;

RTFEditorKit rtfParser = new RTFEditorKit();
Document document = rtfParser.createDefaultDocument();
rtfParser.read(new ByteArrayInputStream(rtfBytes), document, 0);
String text = document.getText(0, document.getLength());

Sorry I can't think of anything else
Vinar AmrutiaVinar Amrutia
Thank Kevin for sharing this information. This helps, I was thinking if there is something I can do within SF to get it done. If all doors close I have to go to Java/.NET services.