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

Attach Multiple File at Once using Apex. Is it possible? Please Help.

I need to upload mutiple attachment at once by selecting them all. Is it possible in salesforce?
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
Check this whether this could be helpful
Hi,Thanks for your reply but actually i was look for attaching multiple file at once.
Anyway i am able to select multiple item but cofused how to save them using javascript.

<apex:page controller="uploadAttachment" id="pageId">
        function handleFileSelect(evt) {
            var temp =; // FileList object

            var output = [];
            for (var i = 0, f; f = temp[i]; i++) {
                output.push('<li><strong>',, '</strong></li>');
            document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';

        window.onload = function onBodyLoad() {
            document.getElementById('files').addEventListener('change', handleFileSelect, false);
    <apex:form id="formId">
    <input type="file" id="files" name="files[]" multiple="true" />
    <output id="list"></output>

        <!--<apex:repeat value="{!attachmentList}" var="iterate">
            <br/><apex:outputText value="{!iterate.Name}" styleClass="test"/><br/><br/>

Any idea on this. Please.