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
Bhaskar@optraBhaskar@optra 

How to access image stored in contentversion object in visual force page???

Hi All,

  I have 10 mb image stored in  a contentversion object. Please guide me for displaying this image in a vf page. Thanks

 

 

 

Bhaskar@optraBhaskar@optra

Hi Dirk,

 

 

              I visit that link u posted.....Good.......That gives the hiper reference to that image in salesforce  chatter files...i dont want that ..completely i need to get that image  in visualforce page ,i want to do some other operation in that image like editing,pointing some part of that image.So please guide me ...........

 

 

Any help greatly appreciate....! :)

 

 

Thanks.

Dirk GronertDirk Gronert

You want to access a file posted in chatter on a record and modify & update it?

--dirk

 

Dirk GronertDirk Gronert

 

try this one: https://c.eu1.content.force.com/sfc/servlet.shepherd/version/download/[CONTENTVERSION.ID]

 

replace [CONTENTVERSION.ID] with the ID of the ContentVersion record and use the url in an image tag!

 

--dirk

Bhaskar@optraBhaskar@optra

Hi Dirk,

 

 

 I tried that link u posted...But i am not getting image...please send me if u have any related vf page example ?

 

 

  I tried the following way.....

 

  <apex:page controller="Myfilesnewimagectrl" sidebar="false" showHeader="false">
      <apex:form >
          <apex:image url="https://c.ap1.content.force.com/sfc/servlet.shepherd/version/download/['06990000000KYyB']"/>    
     </apex:form>
</apex:page>

 

Let me know if any errors in my code.....!

 

 

 

Thanks

Dirk GronertDirk Gronert

You have to use this one:

 

<apex:image url="https://c.ap1.content.force.com/sfc/servlet.shepherd/version/download/06990000000KYyB"/> 

 

without the [''] !!

 

--dirk