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

View the Uploaded content

HI ,  

 I have Uploaded   a file using vf apex code, 

now I wanna view the content or display the content say in a different page, 

So how couldi achieve this..Pls Anyone send me the sample code







Use the below code as reference



______ Vf page ________________
<apex:page controller="displayimage" >
<apex:image url="/servlet/servlet.FileDownload?file={!imageid}" width="50" height="50" />

public class displayimage
public string imageid{get;set;}
public displayimage()


Pass the uploaded file id in the url .

For example call the function on the button click on the upload file image


public PageReference displayimage()
PageReference pageRef= new PageReference('/apex/pagename?id=';
return pageRef;


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.