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
bharath kumar 52bharath kumar 52 

Display names of uploaded files without reloading the page

Hi All,

I have a requirement where in i need to display multiple attachments with the name and  links of the uploaded file in the vf page without reloading. The files are uploaded from chatter feed and  needs to reflect in the below "vf page" . The below page is used inside a iframe.

Below is the code for the vf page :

<apex:page controller="CTRL_USF" showHeader="true" extensions="CTRL_Attachments">
    <apex:sectionHeader title="Upload photo"/>
    <apex:form >
        <apex:pagemessages />
        <br/>
        <apex:outputText >
            <b>1. Select the photo</b>
        </apex:outputText><br/><br/>
        &nbsp; &nbsp; &nbsp;
        <apex:outputText >
            Click the
            <b>"Choose File"
            </b>to find the photo.</apex:outputText><br/><br/>&nbsp; &nbsp; &nbsp;
        <apex:inputFile title="Upload Photo" contentType="{!fileContent.ContentType}" value="{!fileContent.body}" fileName="{!fileContent.name}" id="file"></apex:inputFile>
        <br/><br/><br/>
        <apex:outputText >
            <b>2. Upload Photo</b>
        </apex:outputText><br/><br/>&nbsp; &nbsp; &nbsp;
        <apex:outputText >Click the
            <b>"Upload Photo"</b>
            button.</apex:outputText><br/><br/>&nbsp; &nbsp; &nbsp;
       <!-- <apex:commandButton value="Upload Photo" action="{!savePhoto}"/><br/><br/>-->
    </apex:form>
</apex:page>


Would be glad if someone can help me with this.

Thanks and Regards,

Bharath Kumar M

sandeep madhavsandeep madhav
HI,
Write an action function and render specific block of the page.

Example:
1.   <apex:actionfunction action="savePhoto" name="uploadphoto" rerender="uploadDoc" status="status"/>
Have Salesforce/Custom status, which loads on click on button till u get responce from controller, and an outputpanel to rerender the result
2.   <input type="button" value="Upload Photo" onClick="iploadphoto();"/>
onclick of this button action function will be called
3. <apex:outputpanel id="uploadDoc">
{!Photo_Name}
</apex:outpanel>

Mark this answer as best if this helps.